Intermec PF4i Fingerprint Developer's Guide (old) - Page 79
Left or Right Justifying Data With LSET and RSET, Transferring Data to the File With PUT
View all Intermec PF4i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 79 highlights
Chapter 4 - Managing Input and Output 30 QDATA1$="ABC" 40 QDATA2$="DEF" 50 QDATA3$="12345678" Note: Only string variables can be used. Possible numeric expressions must therefore be converted to strings using STR$ functions. Left or Right Justifying Data With LSET and RSET There are two instructions for placing data into a random file buffer: • LSET places the data left-justified. • RSET places the data right-justified. In other words, if the input data consists of fewer bytes than the field into which it is placed, it is placed either to the left (LSET) or to the right (RSET). If the length of the input data exceeds the size of the field, the data is truncated from the end (LSET), or from the start (RSET). 60 LSET F1$=QDATA1$ 70 RSET F2$=QDATA2$ 80 LSET F3$=QDATA3$ This set of instructions produce the following record: Record: 1 Field: 1 2 3 Byte: 1 2 3 4 1 2 3 4 1 2 3 4 5 6 The first field is left-justified, the second field is right-justified, and the third field is left-justified and truncated at the end. Digits 7 and 8 are omitted since the field is only six bytes long. If the field had been right-justified, then digits 1 and 2 would have been omitted instead. Transferring Data to the File With PUT The next step is to transfer the record to the file using the PUT statement. PUT is always followed by the number assigned to the file when it was OPENed, and the number of the record in which you want to place the data (1 or larger). In our example, the file ZFILE was OPENed as #1 and we want to place the data in the first record. You can place data in whatever record you like. The order is of no consequence. 90 PUT #1,1 You can place data into other records using additional sets of LSET, RSET and PUT statements. Below is an example of a three-record file: Byte: 1 2 3 4 1 2 3 4 1 2 3 4 5 6 1 2 3 4 1 2 3 4 1 2 3 4 5 6 1 2 3 4 1 2 3 4 1 2 3 Intermec Fingerprint Developer's Guide 63