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.

SORT<br />

Purpose Statement for sorting a one-dimensional array.<br />

Syntax SORT,,,<br />

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

Chapter —Program Instructions<br />

is the array to be sorted.<br />

is the number of the first element.<br />

is the number of the last element.<br />

> 0: Ascending sorting<br />

< 0: Descending sorting<br />

= 0: Illegal value<br />

In a string array, the value specifies the position according to<br />

which the array will be sorted.<br />

Remarks A numeric or string array can be sorted, in its entity or within a specified<br />

range of elements in ASCII value order.<br />

The 4:th parameter () is used differently for numeric and string<br />

3<br />

arrays. The sign always specifies ascending or descending order. For numeric<br />

arrays, the value is of no consequence, but for string arrays, the value<br />

specifies for which character position the elements will be sorted. 3<br />

= 0 results in Error 41, “Parameter out of range.”<br />

Example One numeric and one string array are sorted in descending order. The<br />

string array is sorted in ascending according to the third character position<br />

in each string:<br />

10 ARRAY% (0) = 1001<br />

20 ARRAY% (1) = 1002<br />

30 ARRAY% (2) = 1003<br />

40 ARRAY% (3) = 1004<br />

50 ARRAY$ (0) = "ALPHA"<br />

60 ARRAY$ (1) = "BETA"<br />

70 ARRAY$ (2) = "GAMMA"<br />

80 ARRAY$ (3) = "DELTA"<br />

90 SORT ARRAY%,0,3,-1<br />

100 SORT ARRAY$,0,3,3<br />

110 FOR I% = 0 TO 3<br />

120 PRINT ARRAY% (I%), ARRAY$ (I%)<br />

130 NEXT<br />

RUN<br />

yields:<br />

1004 DELTA<br />

1003 GAMMA<br />

1002 ALPHA<br />

1001 BETA

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

Saved successfully!

Ooh no, something went wrong!