Intermec PD41 Fingerprint Developer's Guide (old) - Page 64
Reading a Specific Data Length With INPUT$, Reading a Line to a Variable With LINE INPUT
View all Intermec PD41 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 64 highlights
Chapter 4 - Managing Input and Output 150 PRINT D$ 160 PRINT E$ 170 PRINT F$ 180 CLOSE #1 RUN The printer returns: Record A a b c Record B 1 2 3 Record C xyz Record D Record E Record F Reading a Specific Data Length With INPUT$ INPUT$ reads a specified number of characters from the specified sequential file or channel. By default, if no file or channel is specified, the data on the standard IN channel is read. The execution is held up waiting for the specified number of characters to be received. If a file does not contain as many characters as specified in the INPUT$ statement, the execution resumes as soon as all available characters in the file have been received. Sequential files are read from the start and once a number of characters has been read, they cannot be read again until the file is CLOSEd and OPENed again. Subsequent INPUT$ statements will start with the first of the remaining available characters. Example (reads portions of characters from a file OPENed as #1): 10 OPEN "QFILE" FOR OUTPUT AS #1 20 PRINT #1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 30 CLOSE #1 40 OPEN "QFILE" FOR INPUT AS #1 50 A$=INPUT$(10,1) 60 B$=INPUT$(5,1) 70 C$=INPUT$(100,1) 80 PRINT "Record 1:",A$ 90 PRINT "Record 2:",B$ 100 PRINT "Record 3:",C$ 110 CLOSE #1 RUN The printer returns: Record1: ABCDEFGHIJ Record2: KLMNO Record3: PQRTSUVWXYZ Reading a Line to a Variable With LINE INPUT# This command reads an entire line (including all punctuation) to a string variable. Commas inside a string are treated as punctuation marks and do not divide the string into records. This example reads a complete line in a file and places the data in a "single-string" variable): 48 Intermec Fingerprint Developer's Guide