AKD BASIC User Guide | 3 AKDBASICLanguage
is relop expr (<, =, =, =, > )
is expr (equiv to “is = expr”)
Select-case statements where the case-defn expressions are composed solely of integer con-
stants are evaluated much quicker at run-time. (Cases involving variables must be transformed
to logically equivalent if-then-else statements.)
3.5.26 Static
Static var1 [, var2[...]] as type
where type is:
INTEGER 32 bit integer
FLOAT IEEE single precision float
STRING default length is 32 characters
Static is used for declaring variables before use. All variables (except parameters) must be
declared before they can be used. The Static statement is used in a Function, Sub or Interrupt
to specify that the specified variable's value be remembered even when the Function or Sub is
finished. The next time that the Function, Sub or Interrupt is executed, the value will be avail-
able.
Example:
Main
while 1
call MySub
pause(1)
wend
End Main
'-------------- Subroutines and Functions -----
-------
sub MySub
dim x as integer 'value is forgotten
static y as integer 'value is remembered
x= x + 1
y = y + 1
print x,y
end sub
3.5.27 Stop
Stops the execution of the program.
3.5.28 Sub…End Sub
Sub [argument-list]
...body of the sub-procedure...
End Sub
Declare a subroutine. Invoked via Call. Optionally takes arguments. As with Function, it is ille-
gal to provide an empty parameter list (‘()’) if the subroutine takes no parameters.
Kollmorgen™ | March 30, 2012 34