Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Designator: Declare a Variable Block.

VAR
     Size Symbol < [Count ] > < Size Symbol < [Count ] >>...

...

VAR
     Size Symbol < [Count ] > < , Symbol < [Count ] >>...

  • Size is the desired size of the variable, BYTE, WORD or LONG.
  • Symbol is the desired name for the variable, and must be unique to the object.
  • Count is an optional expression, enclosed in brackets, that indicates this is an array variable, with Count number of elements; each being of size byte, word or long. When later referencing these elements, they begin with element 0 and end with element Count-1.

Explanation

VAR is the Variable Block declaration. The Variable Block is a section of source code that declares global variable symbols. This is one of six special declarations (CON, VAR, OBJ, PUB, PRI, and DAT) that provide inherent structure to the Spin language.

...