DEF

Top  Previous  Next

Syntax

DEF name as type

DEF name[...] as type

Description

Defines a variable.

Parameters

name - Name of new variable.

type - Any built in type or UDT name.

... - Up to 3 array dimensions.

Return value

None

Remarks

Array dimensions must be a constant or resolve to a constant. For dynamic arrays see the NEW statement. A colon ':' may be used as a shortcut to the AS keyword. DIM is a synonym for DEF and the two can be used interchangeably.

You can also use the reverse definition method and eliminate the DEF statement.

See Also: EXTERN, NEW

Example usage

DEF a[10] as INT
DEF b$ as STRING
DEF c[2,10] : WORD
 
'Reverse Definitions
INT a[10]
STRING b$
WORD c[2,10]