AKD BASIC User Guide | 6 AKD BASIC Parameters, Operators, Statements
6.1.6 Dim
General Information
Type Statement
Description
Used for declaring variables before use. All variables (except predefined var-
iables) must be declared before they can be used.
Units N/A
Range N/A
Default
Value
N/A
Data Type N/A
Description
Used for declaring variables before use. All variables (except predefined variables) must be
declared before they can be used. The DIM statement may also be used to specify that a global
variable is non-volatile. When the controller is power-cycled non-volatile variables retain the
value present when the controller was powered down. All other user variables are initialized to
zero.
The default length for strings is 32 characters. This default can be overridden by following the
STRING type designator with a * (see example).
See the examples for how to use DIM to dimension an array.
Example
Dim x,y,z as Integer NV '3 non-volatile
integers
Dim q as float '1 floating point
Dim Array1(4,5) as Integer 'a 4x5 array
Dim A$ as String*50 'a 50 character string
Related Topics
Static
103 Kollmorgenâ„¢ | March 30, 2012