Intermec PX4i Fingerprint Developer's Guide (old) - Page 56
Splitting String Expressions, Calculating String Array Checksums, Checking
View all Intermec PX4i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 56 highlights
Chapter 3 - Managing Files 1000 No. 3 1001 No. 2 1002 No. 1 1003 No. 0 Splitting String Expressions The SPLIT function splits a string expression into elements in an array and to return the number of elements. A specified character indicates where the string will be split. In this example a string expression is divided into six parts by the separator character "/" (ASCII 47 dec.) and arranged in a six-element array: 10 A$="ONE/TWO/THREE/FOUR/FIVE/SIX" 20 X$="ARRAY$" 30 DIM ARRAY$(6) 40 B%=SPLIT(A$,X$,47) 50 FOR C%=0 TO (B%-1) 60 PRINT ARRAY$(C%) 70 NEXT RUN The printer returns: ONE TWO THREE FOUR FIVE SIX Calculating String Array Checksums The checksum for string arrays can be calculated according to one of three different algorithms and returned using the CSUM statement. Note: Do not confuse CSUM with CHECKSUM. For help, see "Checking Transferred Files With CHECKSUM" on page 38. In this example, the checksum of a string array is calculated according both to the LRC (Logitudinal Redundancy Check) and the DRC (Diagonal Redundancy Check) algorithms: 10 FOR Q%=0 TO 3 20 A$=STR$(Q%) 30 ARRAY$(Q%)="Element No. "+A$ 40 NEXT 50 CSUM 1,ARRAY$,B%:PRINT "LRC checksum: ";B% 60 CSUM 2,ARRAY$,C%:PRINT "DRC checksum: ";C% RUN The printer returns: LRC checksum: 0 DRC checksum: 197 40 Intermec Fingerprint Developer's Guide