8.6.9 Variables

A variable name consists of 1 to 15 characters. The first one must be a letter, and the rest may be letters or digits. Letters may be upper or lower-case, but lower and upper-case letters are considered different. Thus, the variables abc and aBc are different.

Variables may be menu variables or shell variables. The shell variables in menu's environment cannot be changed. However, any menu variable may be exported to DOS commands executed by menu.

The value of a menu variable is set with the ask, export and set menu commands or with a parameter form. The value of a variable is accessed by variable substitution ($variable) or in an expression.

Menu variables are introduced (created) the first time the value of a variable is set and must be introduced before being accessed. Menu variables introduced in menufile commands or menu commands are global. Their values are accessible in any command after it's introduction. Menu variables introduced in choice commands are local and cease to exist after the choice commands complete.

Menu variables are only available when built-in commands are enabled.