Data folders in Igor Pro
Igor's experiment is a tree, and data folders are how an analysis keeps its work apart.
Function AnalyzeIn(String folderName)
DFREF saved = GetDataFolderDFR()
NewDataFolder/O/S $folderName
Make/O/N=100/D result = p^2
DFREF here = GetDataFolderDFR()
WAVE result = here:result
Printf "%s holds %d points\r", GetDataFolder(0), numpnts(result)
SetDataFolder saved
End
How it works
NewDataFolder/Omakes one;SetDataFoldermoves the current one.- A
DFREFholds a folder the way a WAVE holds a wave. - Save and restore the current folder, or you leave the user somewhere else.
Keywords and builtins used here
DFREFEndFunctionGetDataFolderGetDataFolderDFRMakeNewDataFolderPrintfSetDataFolderStringWAVEnumpnts
The run, in numbers
- Lines
- 12
- Characters to type
- 278
- Tokens
- 54
- Three-star pace
- 80 tpm
At the three-star pace of 80 tokens a minute, this run takes about 40 seconds.
Step 2 of 2 in Where data lives, step 17 of 18 in Language basics.