Reading Macintosh Sequential Files Randomly and Vice Versa (20573)
The information in this article applies to:
- Microsoft QuickBASIC 1.0
- Microsoft QuickBASIC 1.0a
- Microsoft QuickBASIC 1.0b
- Microsoft BASIC Compiler
- Microsoft BASIC Interpreter for Apple Macintosh 2.0
- Microsoft BASIC Interpreter for Apple Macintosh 2.1
- Microsoft BASIC Interpreter for Apple Macintosh 3.0
This article was previously published under Q20573 SUMMARY
This information applies to Microsoft QuickBASIC Versions 1.00, 1.00a,
1.00b, Microsoft BASIC Compiler Version 1.00, and Microsoft BASIC
Interpreter Versions 2.00, 2.10, and 3.00 for the Apple Macintosh.
To read with Sequential access from a file created with Random access,
you must put a carriage-return character, CHR$(13), at the end of each
Random record. In Sequential access, each record is delimited with a
carriage-return character, and records can have different lengths.
To read with Random access from a file created with Sequential access,
all the records must have the same length; otherwise, the records will
not line up properly into the fielded variables. Each record in a file
created sequentially will have the number of characters written to it
plus an extra byte for the return CHR$(13) at the end. The record
length specified in the random OPEN statement should thus reflect the
number of characters in the record plus a byte for the return.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB20573 |
---|
|