Lists in a string in Igor Pro
Igor's list is a delimited string, and a handful of functions treat it as a sequence.
Function ShowWaves()
String list = WaveList("data_*", ";", "")
Variable i, n = ItemsInList(list)
for (i = 0; i < n; i += 1)
String name = StringFromList(i, list)
WAVE w = $name
Printf "%-20s %d points\r", name, numpnts(w)
endfor
list = AddListItem("summary", list, ";", inf)
Print ItemsInList(list, ";")
End
How it works
ItemsInListcounts;StringFromListreads one item by index.AddListItemandRemoveFromListreturn a new list.WaveListandTraceNameListhand you lists in exactly this form.
Keywords and builtins used here
AddListItemEndFunctionItemsInListPrintPrintfStringStringFromListVariableWAVEWaveListendforforiinfnumpnts
The run, in numbers
- Lines
- 13
- Characters to type
- 309
- Tokens
- 81
- Three-star pace
- 75 tpm
At the three-star pace of 75 tokens a minute, this run takes about 65 seconds.
Step 2 of 4 in Text, step 13 of 18 in Language basics.