Contents
Index 🔎︎

# Loc Function

Returns the current position in an open file.

## Syntax:

    Loc(FileNumber)

## Return value:

Long

## پارامېتىر

FileNumber: Any numeric expression that contains the file number that is set by the Open statement for the respective file.

If the Loc function is used for an open random access file, it returns the number of the last record that was last read or written.

For a sequential file, the Loc function returns the position in a file divided by 128. For binary files, the position of the last read or written byte is returned.

### Error codes:

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err5 not found).

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err52 not found).