[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A variable declaration looks like this:
var variable identifier: type identifier; ... variable identifier: type identifier; |
var variable identifier: type definition; ... variable identifier: type definition; |
var variable identifier: type identifier value constant expression; ... variable identifier: type identifier value constant expression; |
var variable identifier: type definition value constant expression; ... variable identifier: type definition value constant expression; |
A variable declaration part begins with the reserved word var
.
It declares a variable identifier whose type
either can be specified by a type identifier, or by a type definion which
either can be an array, a record, a set, a subrange, an enumerated type
or a pointer to an type identifier.
If value
is specified followed by a constant expression satisfying
the specified type, the variable declared is initialized with
constant expression.
The reserved word value
can be replaced by `=', however
value
is not allowed in ISO-Pascal and Borland Pascal, and the
replacement by `=' is not allowed in Extended Pascal.