
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.
Содержание BHT-BASIC 100 SERIES
Страница 1: ......
Страница 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Страница 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Страница 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Страница 192: ...Chapter 14 Statement Reference 184 Example OPEN master Dat AS 1 FIELD 1 20 AS bar 10 AS ky CLFILE 1 CLOSE 1...
Страница 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...
Страница 349: ...341 Run time errors Error code Meaning 05h Parameter out of the range checktype is out of the range...
Страница 383: ...375 Run time errors Reference Error code Meaning 05h Parameter out of the range Functions LEFT LEN and RIGHT...