AKD BASIC User Guide | 3 AKDBASICLanguage
const y = 17
'unsupported
const x = y + 2
const y = x - 2
Like alias, variable, and function declarations, Const declarations made in the global scope are
imported into all functions (including the main function).
3.5.5 Dim
Dim var1 [, var2 [...]] as type [NV]
All variables must be declared. Local variables must be declared in the function before use.
The NV specifier is used on a Dim statement in the global scope.
Variables in the global scope are automatically imported into functions and subroutines. Var-
iables in function scope (including inside the main function) are not accessible in other func-
tions.
Arrays cannot be assigned directly.
'This is not allowed
dim x(5), y(5) as integer
x = y
'Instead, a loop is needed:
dim x(5), y(5), i as integer
for i = 1 to 5
x(i) = y(i)
next i
3.5.6 Exit
Exit {{Sub|Function|Interrupt|For|While}]
Exits the closest enclosing context of the specified type. It is a compile-time error to EXIT a
construct not currently in scope.
3.5.7 For…Next
For loop_counter = Start_Value To End_Value [Step increment]
...statements...
Next
If step increment is not specified, uses 1 as the step increment. If step increment is positive,
continues to the value of End_Value. If step increment is negative, continues to the value of var
= limit.
The loop index variable must be a simple identifier, not an array element or a parameter and
must be a numeric variable (integer or float).
for var = init to limit step delta
stlist
next var
Substantially more efficient code is generated if delta is a constant (i.e., the default value of 1 is
used, or specified as an expression that is evaluated at compile-time).
29 Kollmorgenâ„¢ | March 30, 2012