strictvars Mode

The strictvars statement turns on or off strictvars mode. If strictvars mode is on, then variables must be declared before you use them. By default, strictvars mode is off.

The strictvars statement syntax is:

strictvars <value>

where <value> is true or "1' to enable the mode, or false or "0' to disable the mode.

For example:

strictvars true

i = 0     // error: the variable i has not been declared

If you refer to a variable that has not been declared, and strictvars mode is enabled, then you will get an error. For example:

var s

s = somestring    // error if variable "somestring' is not declared

If the strictvars mode is enabled, then identifiers must be defined variables, and the identifier name will never be used as a literal string.

Note that the strictvars statement is an executed statement, and must be in the path of execution. If the program never runs the strictvars statement, then the mode is not changed. Further, you can use the strictvars statement more than once turn the mode on or off.