Section 10: Instrument programming Model 2601B-PULSE System SourceMeter Instrument Reference Manual
10-14 2601B-PULSE-901-01A April 2020
Comments
You can start a comment anywhere outside a string by typing a double hyphen (--). If the text
immediately after -- is anything other than double left brackets ([[), the comment is a short
comment, which continues until the end of the line.
If -- is followed by [[, the following characters are a long comment, which continues until double
right brackets (]]) close the comment. Long comments may continue for several lines and may
contain nested [[ . . . ]] pairs. The example below shows how to use code comments.
An example of a short comment is:
-- Turn off the front-panel display.
An example of a long comment is:
--[[Display a menu with three menu items. If the second menu item is selected,
the selection will be given the value Test2.]]
Function and variable name restrictions
You cannot use factory script names, functions created by factory scripts, Lua reserved words and
top-level command names for function or variable names.
For information on factory script names, see Factory scripts (on page 9-19).
You cannot use the following Lua reserved words for function or variable names.
You also cannot use top-level command names as variable names. If you use these names, it will
result in the loss of use of the commands. For example, if you send the command digio = 5, you
cannot access the digio.* commands until you turn the instrument power off and then turn it on
again. These names include: