Chapter 14. Statement Reference
206
Syntax:
DIM arraydeclaration[,arraydeclaration...]
Parameter:
arraydeclaration
numericvariable (subscript)
DIM n1%(12)
DIM n2(5,6)
stringvariable (subscript)[[stringlength]]
DIM s1$(2)
DIM s2$(2,6)
DIM s3$(4)[16]
DIM s4$(5,3)[30]
subscript
For one-dimensional:
integerexpression
For two-dimensional:
integerexpression,
integerexpression
Where
integerexpression
is a numeric expression which returns
a value from 0 to 254.
stringlength
An integer constant that has a value from 1 to 255 which indicates the
number of characters.
Description:
DIM
declares array variables and dimensions the arrays that a program will utilize.
• A
DIM
statement can appear anywhere before the first use of the array in a
source program. However, when possible, you should place all your
DIM
state-
ments together near the beginning of the program and should not place them in
the program execution loops in order to prevent errors.
• Up to 2-dimensional array variables can be declared.
DIMension
Memory control statement
DIM
Declares and dimensions arrays; also declares the string length for a string variable.
Summary of Contents for BHT-BASIC 100 SERIES
Page 1: ......
Page 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Page 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Page 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Page 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...