SCALAR INDEX

SCALAR _ _ _ _ _ _ _ _ _ _ _ _ declaration

The scalar declaration must be made immediately after a begin (or other variable declaration such as integer and real) and declares local scalar variables. They are initialized to 0.

syntax:

scalar<identifier>{,<identifier>}*

<identifier> may be any valid REDUCE identifier, except t or nil.

Scalar variables remain local, and do not share values with variables of the same name outside the begin...end block. When the block is finished, the variables are removed. You may use the words real or integer in the place of scalar. real and integer do not indicate typechecking by the current REDUCE; they are only for your own information. Declaration statements must immediately follow the begin, without a semicolon between begin and the first variable declaration.

Any variables used inside begin...end blocks that were not declared scalar, real or integer are global, and any change made to them inside the block affects their global value. Arrays declared inside a block are always global.