Microsoft KB Archive/46720

= VARPTR(#filenumber) Not Supported in QB 4.x or BC 6.00, 7.00 =

Article ID: 46720

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q46720



SUMMARY
Instead of passing the file number (#n) to the VARPTR function for a random access file, you may use VARPTR to take the address of the first variable defined in the FIELD statement to return the address of the FIELD buffer.

This information applies to Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS, to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS, and to Microsoft Basic PDS Version 7.00 for MS-DOS.



MORE INFORMATION
In QuickBasic Versions 2.00, 2.01, and 3.00, the VARPTR function can be passed the file number (#n) of a previously OPENed file. For sequential access files, VARPTR(#n) then returns the starting address of the disk I/O buffer assigned to that file number. For random access files, VARPTR(#n) returns the address of the FIELD buffer assigned to that file number.

In QuickBasic Versions 4.00, 4.00b, and 4.50 (and in the Basic compiler Versions 6.00 and 6.00b and Basic PDS 7.00), you cannot use VARPTR with a file number (#n) as an argument. This feature has been eliminated. You can now use the FILEATTR function, which returns the Basic access mode and the DOS file handle, which may be useful for DOS file interrupts.

Additional query words: QuickBas BasicCom

Keywords: KB46720

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.