AKD BASIC User Guide | 3 AKDBASICLanguage
Similarly, 3 or 4 has the value –1(TRUE since at least one operand is not FALSE), while 3 bitor
4 has the value 7 (the three lsb’s are set).
Remember that relational and logical operators return numeric values - 0 for FALSE and -1 for
TRUE. Any value not equal to FALSE is considered to be logically equivalent to TRUE for pur-
poses of the logical operators.
It is syntactically incorrect to code:
dim a, b, c, x as integer
x = a < b < c
3.7.4 String Operators
Operator Assoc Name
<, >, ≤, ≥ nonassoc string comparisons
=, <> nonassoc string comparisons
left string concatenation
There is no implicit coercion between strings and numeric types. String comparison is case-sen-
sitive. Relative comparisons are made using ASCII lexical ordering. The empty string sorts
before all other strings. String comparison operators are non-associative because they evaluate
to a numeric value.
3.7.5 Example
It makes no sense to say a$ = b$ = c$.
It is sensible to say x = a$ = b$
x is assigned the value TRUE if a$ is the same as b$, and FALSE otherwise.
3.8 Function Invocation
A function invocation is denoted as:
var = func(arg1, arg2, ..., argn)
The arguments are passed by value (i.e., modifications made to the formal parameters inside a
function are not reflected in the actuals). Arrays are also passed by value to functions. Arrays
cannot be returned by a function. A function of no arguments is invoked by using the function
name alone. For example, if func_none takes no arguments, then func_none is correct and
func_none() is invalid.
The return value of a function may not be ignored by the caller. If the return value of a function
is regularly ignored, the function should be rewritten as a subroutine (a function with no return
value).
3.8.1 $INCLUDE
Use $INCLUDE to textually include one file in another. The $INCLUDE facility is a simple,
powerful way to create a consistent family of applications. By including source files containing
commonly used functions, subroutines, constant definitions, aliases, etc., you have control
over the source for each application. When you change the source, you update each appli-
cation simply by recompiling (see Optimizations).
A file cannot include itself, either directly or indirectly. Include file nesting is allowed, but lim-
ited to a pre-defined maximum depth (currently 16).
The path of an include file is relative to the directory of the included file, not the current working
directory of the compiler. Suppose, for example, the source program is in directory C:\WORK,
Kollmorgenâ„¢ | March 30, 2012 38