"Bad Record Length" GET#n,,x$ Variable-Length String from File (42665)
The information in this article applies to:
- Microsoft QuickBASIC 4.0, when used with:
- the operating system: MS-DOS
- Microsoft QuickBASIC 4.0b, when used with:
- the operating system: MS-DOS
- Microsoft QuickBASIC 4.5, when used with:
- the operating system: MS-DOS
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
This article was previously published under Q42665 SUMMARY
The run-time error "Bad record length" occurs when a QuickBasic
Version 4.00b or 4.50 program uses a variable-length string as the
third argument in a GET statement to input a string that was PUT in
the file as a fixed-length string. This information also applies to
Microsoft Basic Compiler Version 6.00b for MS-DOS and MS OS/2 and
Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2.
No error occurs in QuickBasic Version 4.00 or Basic compiler Version
6.00 because these earlier versions don't expect a 2-byte string
length when you input a variable-length string as the third argument
of the GET statement. For a related article discussing PUT, query on
the following words in this Knowledge Base:
BAD RECORD LENGTH and PUT
When reading from a random file that was created using fixed-length
strings, you should GET them using fixed-length strings also.
Modification Type: | Minor | Last Reviewed: | 1/9/2003 |
---|
Keywords: | KB42665 |
---|
|