[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
As part of a variable declaration part or in a statement block:
var variable identifier: type identifier; |
var variable identifier: type definition; |
var variable identifier: type identifier value constant expression; |
var variable identifier: type definition value constant expression; |
As part of a parameter list (passing by reference):
var var parameter: type identifier; |
var var parameter; |
or protected (i.e., the called routine can't modify the parameter):
protected var var parameter: type identifier; |
protected var var parameter; |
In a declaration part: The reserved word `var' declares a variable identifier whose type is of type identifier or which is defined by type definition. For further description see section 8.1.5 Variable Declaration, section 8.1.4 Type Declaration, section 8.2.1 Type Definition, section 8.2 Data Types.
In a parameter list: see section 8.1.6.4 Subroutine Parameter List Declaration.
`var' is defined in ISO-7185 Pascal and supported by all known Pascal variants. Untyped `var' parameters in parameter lists are a UCSD Pascal extension. The ability to do `var' declarations in a statement block is a GNU Pascal extension.
program VarDemo; |
section 9.284 type, section 9.14 array, section 9.222 record, section 9.244 set, section 8.2.10.1 Subrange Types, section 9.196 Pointer, section 9.206 protected.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |