Incorrect SEEK in Example in Basic 7.00 Language Reference (63901)



The information in this article applies to:

  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0

This article was previously published under Q63901

SUMMARY

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
				

Modification Type:MajorLast Reviewed:10/20/2003
Keywords:KB63901