Loc Function


Loc Function

Class

Microsoft.VisualBasic.FileSystem

Syntax

     Dim result As Long = Loc(fileNumber) 


fileNumber (required; Integer)

Any valid file number of a file opened with FileOpen

Description

The Loc function indicates the current 0-based position within an open file.

Usage at a Glance

  • For files opened in Binary mode, Loc returns the position of the last byte read or written. For files opened in Random mode, Loc returns the record number of the last record read or written. For files opened in Input or Output modes (sequential), Loc returns the current byte position in the file, divided by 128.

  • For sequential files, the return value of Loc is not consistent and should not be used.

  • The current position in the file cannot be changed using the Loc function.

Version Differences

In Visual Basic 2005, the My.Computer.FileSystem object provides more robust access to file-management features.

See Also

FileOpen Procedure, LOF Function, Seek Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net