17.08.2013 Views

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DIM<br />

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

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

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

Chapter 2 Program Instructions<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<br />

dimensions (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 parentheses.<br />

Each subscript represents a dimension. The number of subscripts in an array<br />

variable, the first time (regardless of line number) it is referred to, decides its<br />

number of dimensions. The number of elements in each dimension is by<br />

default restricted to four (No. 0–3).<br />

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

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 />

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 be<br />

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 />

<strong>Intermec</strong> Fingerprint 7.2 – Reference Manual Ed. 3 62

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

Saved successfully!

Ooh no, something went wrong!