BASIC FUNCTIONS
VER.V09F
SECTION 5.5
a DIM statement followed by string name, the number of
elements in the array, and the maximum string length
required.
DIM A$(25, 10)
defines a string array· with 25 elements each of maximu.m
length of 10 characters.
Each character in a string requires 1 byte of storage.
Since HUNTER retains variable definitions indefinitely, DIM
statements should not be included in normal user program
sequences. Instead, arrays should be initialised by a
separate routine or defined directly i.e. without line
numbers.
A useful technique is to set in the application software a
switch indicating whether the program is being used for the
first time or not.
If the switch is a variable which is
made non zero when the program is first run, the fact that
any modifications or use of the CLEAR statement will clear
the value to zero can be used to determine whether the
arrays should be redefined or not.
10 If A= 1 THEN
GO TO 100
20
DIM J(50)
90 A = 1
100 REM user program starts here.
NOTE: That the variable A could be used as a counter to
indicate the number of times that the program has been run.
Default values for numeric arrays are 10 elements. Strings
default to one element of 20 characters, larger strings
have to be dimensioned. ·
PAGE 5 - 28