KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q63901: Incorrect SEEK in Example in BASIC 7.00 Language Reference

Article: Q63901
Product(s): See article
Version(s): 7.00 7.10 | 7.00 7.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | SR# S900712-2 docerr | mspl13_basic
Last Modified: 15-JAN-1991

On page 323 of the "Microsoft BASIC 7.0: Language Reference" manual,
the example for the SEEK statement (on the 6th line from the bottom)
incorrectly shows that the process for backing up a file is as
follows:

   SEEK #1, SEEK(1) - LEN(RecordVar)

This statement is the correct method for backing up one record
position in a binary file. In a binary file, the SEEK function refers
to a byte in the file. Therefore, to move forward or backward a
record, you would increment or decrement by the number of bytes in
each record of the file.

However, because the file in the SEEK example on page 323 is a RANDOM
access file, a SEEK function refers to each record in the file, not to
each byte in the file. Thus, the statement should be corrected to read
as follows:

   SEEK #1, SEEK(1) - 1

This information applies to Microsoft BASIC Professional Development
System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.