Not sure about a text wave, but it's possible for a numerical wave with the sockitwavetostring operation.
It's easy to develop an xop to do what you want, but how would you delimit successive elements?
Not sure about a text wave, but it's possible for a numerical wave with the sockitwavetostring operation.
It's easy to develop an xop to do what you want, but how would you delimit successive elements?
Well, that's the point. I don't want to delimit the elements. I just want to map the data in the memory to the string variable.
Another solution to this would be a kind of Redimension/n=1 textWave, that just removes the delimiters in the textwave preserving the whole content. One could then write str = textWave[0] or use the text wave directly.
Not sure about a text wave, but it's possible for a numerical wave with the sockitwavetostring operation.
It's easy to develop an xop to do what you want, but how would you delimit successive elements?
Well, that's the point. I don't want to delimit the elements. I just want to map the data in the memory to the string variable.
Another solution to this would be a kind of Redimension/n=1 textWave, that just removes the delimiters in the textwave preserving the whole content. One could then write str = textWave[0] or use the text wave directly.
A.
Ok then, that's really very simple. I can cook something up for you in the next couple of days. THe operation I was talking about before basically does the same for numeric waves, it won't be too difficult to add an option for a text wave.
I've updated the SOCKIT XOP to have an operation of this type.
Only OS X version is available at the moment, but I'll build the windows version tonight.
Thanks Andy.
I will look into it. But the longer I think about it the more I feel that this feature should be built right into Igor itself.
make/t tester = num2istr(p) string wally = ""
sockitwavetostring tester, wally print wally // may need to record string lengths at some point make/n=(numpnts(tester))/I/U W_stringlengths = strlen(tester)
It's easy to develop an xop to do what you want, but how would you delimit successive elements?
August 25, 2010 at 01:53 pm - Permalink
Well, that's the point. I don't want to delimit the elements. I just want to map the data in the memory to the string variable.
Another solution to this would be a kind of
Redimension/n=1 textWave
, that just removes the delimiters in the textwave preserving the whole content. One could then writestr = textWave[0]
or use the text wave directly.A.
August 25, 2010 at 03:32 pm - Permalink
Ok then, that's really very simple. I can cook something up for you in the next couple of days. THe operation I was talking about before basically does the same for numeric waves, it won't be too difficult to add an option for a text wave.
August 25, 2010 at 05:28 pm - Permalink
make/t test = num2istr(p)
sockitwavetostring test, tooler
print tooler
zippedtooler = zipencode(tooler) //requires the ZIP XOP.
Only OS X version is available at the moment, but I'll build the windows version tonight.
Andy
August 25, 2010 at 07:45 pm - Permalink
Thanks Andy.
I will look into it. But the longer I think about it the more I feel that this feature should be built right into Igor itself.
Andreas
August 26, 2010 at 01:27 am - Permalink
Usage:
string wally = ""
sockitwavetostring tester, wally
print wally
// may need to record string lengths at some point
make/n=(numpnts(tester))/I/U W_stringlengths = strlen(tester)
August 26, 2010 at 05:04 pm - Permalink