02.10.2012 Views

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter —Program Instructions<br />

DIM<br />

Purpose Statement specifying the dimensions of an array.<br />

Syntax DIM([,...])....[,<br />

([,...])]<br />

| is the name of the array.<br />

is the max. subscript value for the first dimension.<br />

are, optionally, the max. subscript value for the following dimensions<br />

(No. 2-10).<br />

Remarks An array is created by entering a variable followed by a number of subscripts<br />

(max 10) separated by commas. All the subscripts are enclosed by<br />

parentheses. Each subscript represents a dimension. The number of subscripts<br />

in an array variable, the first time (regardless of line number) it is<br />

referred to, decides its number of dimensions. The number of elements in<br />

each dimension is by default restricted to four (No. 0-3).<br />

If more than 4 elements in any dimension is desired, a DIM statement<br />

must be issued. Note that 0 = 1:st element, 1 = 2:nd element, etc.<br />

For example ARRAY$(1,2,3) creates a three-dimensional array, where the<br />

dimensions each contain 4 elements (0-3) respectively. This corresponds to<br />

the statement DIM ARRAY$(3,3,3).<br />

It is not possible to change the number of dimensions of an array that<br />

already has been created during runtime. (Error 57, “Subscript out of<br />

range” will occur.)<br />

Considering the printer’s limited memory and other practical reasons, be<br />

careful not to make the arrays larger than necessary. A DIM statement can<br />

be used to limit the amount of memory set aside for the array.<br />

Examples This example creates an array containing three dimensions with 13 elements<br />

each:<br />

100 DIM NAME$(12,12,12)<br />

Here, two one-dimensional arrays are created on the same program line:<br />

10 DIM PRODUCT$(15), PRICE%(12)<br />

20 PRODUCT$(2)="PRINTER"<br />

30 PRICE%(2)=1995<br />

40 PRINT PRODUCT$(2);" $";PRICE%(2)<br />

RUN<br />

yields:<br />

PRINTER $1995<br />

70 <strong>Intermec</strong> Fingerprint <strong>v8.70.0</strong>/v10.0.0 Programmer´s <strong>Reference</strong> <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!