What would be the correct syntax for extracting a string from a string list and then assign that string to a name of a wave?
I can never get the compile to pass, sigh...
Thank you thomas and A.G., I don't have Igor7 installed yet. I downloaded demo and see what the function is. Is there a way to see "inside" of functions contained in Igor?
What would be the correct syntax for extracting a string from a string list and then assign that string to a name of a wave?
I can never get the compile to pass, sigh...
It's not clear from your question whether your string list is a list of names of already existing waves or is a list of names to be used when creating new waves. Consequently, there are two possible solutions.
For both cases use sName = StringFromList(index, listStr [, listSepStr ]) to get a list item. I suggest you look up the StringFromList function in command help to get a better understanding of the syntax.
Then, for the first case, get a reference to the wave with Wave wTemp = $sName.
For the second case, create the wave and get a reference to it with something like the following:
Make/O $sName Wave wTemp = $sName
Here's a snippet to demonstrate how the second case could be used:
March 24, 2017 at 11:23 am - Permalink
A.G.
WaveMetrics, Inc.
March 24, 2017 at 02:36 pm - Permalink
March 30, 2017 at 03:12 pm - Permalink
It's not clear from your question whether your string list is a list of names of already existing waves or is a list of names to be used when creating new waves. Consequently, there are two possible solutions.
For both cases use
sName = StringFromList(index, listStr [, listSepStr ])
to get a list item. I suggest you look up the StringFromList function in command help to get a better understanding of the syntax.Then, for the first case, get a reference to the wave with
Wave wTemp = $sName
.For the second case, create the wave and get a reference to it with something like the following:
Wave wTemp = $sName
Here's a snippet to demonstrate how the second case could be used:
String sList = "Name1;Name2;Name3"
String sName = ""
Variable nIndex = 0
Do
sName = StringFromLIst(nIndex, sList, ";")
if( StrLen( sName ) == 0 )
break
endif
Make/O/N=5 $sName
Wave wTemp = $sName
print wTemp
nIndex += 1
While(1)
End
This example is fine for version 6.xx of Igor.
Hope this helps.
March 31, 2017 at 05:44 am - Permalink
March 31, 2017 at 02:05 pm - Permalink