AKD BASIC User Guide | 3 AKDBASICLanguage
0.1
.1
-.1
-0.1
3.14159E-6
-1.0E6
are all valid floating point constants. By design, “.” is not a legal floating-point constant.
3.5 Statements
Statements are separated by a new line (CR-LF) or a colon (‘:’). The statements of the language
are:
3.5.1 Alias
Create an alias for an identifier (not just any identifier). Alias is either a parameter or another
alias. ID must be a legal variable name. You cannot create an alias for an array element.
Like Const definitions, Alias definitions can be made to identifiers not yet defined. Circular def-
initions are not allowed.
Any duplicate definition of an identifier in the same scope is illegal. However, a local definition
can shadow a definition from the global scope. Using a single identifier to denote two different
objects is NOT allowed (i.e., you cannot have both a label and a variable named all_done).
Like constant, variable, and function declarations, Alias declarations made in the global scope
are imported into all functions (including the main function).
Example:
Alias speed = MOTOR.SPEED ‘save some key-
strokes
3.5.2 Call
Call sub[(arg1, arg2, ...)]
sub is the name of a subroutine. The current program counter is saved and sub is invoked.
When sub finishes (by reaching either an exit sub or end sub statement, control is returned to
the statement logically following Call.
A subroutine is essentially a function with no return value. The parameter passing conventions
followed by subroutines are the same as those followed by functions.
3.5.3 Cls
This statement transmits 40 line-feed characters (ASCII code = 10) to the serial port. Cls clears
the display of the console.
3.5.4 Const
const name = x
Declares symbolic constants to be used instead of numeric values. Forward references are
allowed, but circular references are not supported.
'supported
const x = y + 2
Kollmorgen™ | March 30, 2012 28