
An array variable name has as many dimensions as there are subscripts in the array. For
example,
A(12)
would reference a value in a one dimension array.
T(2,5)
would reference a value in a two-dimension array.
... and so on.
Each element in an array is referenced by an array variable that is subscripted with an
integer or an integer expression. For example,
DIM IntegerA%(20)
: It declares an integer array with 20 elements.
DIM StringB$(100)
: It declares a string array with 100 elements.
DIM RealC!(10)
: It declares an integer array with 10 elements.
DIM Tb(5,5)
: It declares a two-dimension integer array with 5x5 elements.
ArrayD(i+1,j)
: The elements of an array are subscripted with an integer expression.
The first element of an array is subscripted with 1.
In the BASIC language, the maximum number of dimensions for an array is 2, and, up
to 32,767 elements per dimension is allowed while compiling.
4.3 Expression and Operators
An expression may be a string or numeric constant, or a variable, or it may be a combination
of constants and variables with operators to produce a single value.
Operators perform mathematical or logical operations. The operators provided by the
BASIC Compiler may be divided into four categories, namely, Assignment Operator,
Arithmetic Operators, Relational Operators, and Logical Operators.
4.3.1 Assignment Operator
The BASIC Compiler supports an assignment operator: "=".
For example,
Length% = 100
PI! = 3.14159
Company$ = "Metrologic Instruments Inc."
Comentarios a estos manuales