Variables and strings in Igor Pro
Igor has few types and they are all declared: numbers, text, and references to waves.
Constant kSampleRate = 20000
StrConstant ksUnit = "mV"
Function Describe()
Variable gain = 4.7
Variable count = 12
String name = "trace_a"
String note = name + " at " + num2str(gain) + " " + ksUnit
Print note, count / kSampleRate
End
How it works
Variableis a double;Stringis text; there is no separate integer.- A local declaration can initialize on the same line.
ConstantandStrConstantare file-level and cannot change.
Keywords and builtins used here
ConstantEndFunctionPrintStrConstantStringVariablenotenum2str
The run, in numbers
- Lines
- 11
- Characters to type
- 235
- Tokens
- 46
- Three-star pace
- 70 tpm
At the three-star pace of 70 tokens a minute, this run takes about 39 seconds.
Step 1 of 3 in Variables & functions, step 5 of 18 in Language basics.