The var statement declares a local variable, and sets it value to the empty string (nil).
You can declare more than one variable by separating the variables with a comma. For example:
var a, b, c // declares three variables
A local variable cannot be accessed outside of its function.
You don't have to declare variables if strictvars mode is off (default), but there are a couple of benefits if you do:
Syntax formatting works in the display for references to it.
Variables are initialized to the empty string value, nil, so they are not confused with literal values when used without being initialized.
// "localx" is displayed with "Ref to Local" style
localx = 0
You can use the strictvars statement to require variable declarations.