Programming instructions

Intermec Fingerprint v7.61 Programmers Reference Manual Ed. 7 245
Chapter 2 Program Instructions
SPLIT
Field of Application
Function splitting a string into an array according to the position
of a speci ed separator character and returning the number of
elements in the array.
Syntax SPLIT(<sexp
1
>,<sexp
2
>,<nexp>)
<sexp
1
> is the string to be split.
<sexp
2
> is the string array in which the parts of the split string
should be put.
<nexp> speci es the ASCII value for the separator.
Remarks
The string is divided by a speci ed separating character which may found
an in nite number of times in the string. Each part of the string will
become an element in the string array, but the separator character itself
will not be included in the array.
Should the string be split into more than four elements, Error 57, Subscript
out of range will occur. To avoid this error, issue a DIM statement to create
a larger array before the string is split.
Example
In this example a string is divided into ve parts by the separator character
# (ASCII 35 decimal). The result will be an array of ve elements numbered
0-4 as speci ed by a DIM statement. Finally, the number of elements is
also printed on the screen.
10 A$="ONE#TWO#THREE#FOUR#FIVE"
20 B$="ARRAY$"
30 DIM ARRAY$(5)
40 C%=SPLIT(A$,B$,35)
50 PRINT ARRAY$(0)
60 PRINT ARRAY$(1)
70 PRINT ARRAY$(2)
80 PRINT ARRAY$(3)
90 PRINT ARRAY$(4)
100 PRINT C%
RUN
yields:
ONE
TWO
THREE
FOUR
FIVE
5