File Class

A File object can be obtained by calling OpenFile(). File objects should be closed with delete or Close(). Note that, "delete file" does not actually delete the file, it just closes the handle.

Methods 18

Name Description
Close

Close the file handle. This is the same as using CloseHandle() or delete.

EndOfFile

Tests if the end of file has been reached.

Flush

Flushes a file's buffered output; any buffered output is immediately written to the file.

Read

Reads binary data from a file.

ReadInt16

Reads a single int16 (short) from a file. The value is sign-extended to an int32.

ReadInt32

Reads a single int32 (int/cell) from a file.

ReadInt8

Reads a single int8 (byte) from a file. The returned value is sign- extended to an int32.

ReadLine

Reads a line of text from a file.

ReadString

Reads a UTF8 or ANSI string from a file.

ReadUint16

Reads a single unt16 (unsigned short) from a file. The value is zero- extended to an int32.

ReadUint8

Reads a single uint8 (unsigned byte) from a file. The returned value is zero-extended to an int32.

Seek

Sets the file position indicator.

Write

Writes binary data to a file.

WriteInt16

Writes a single int16 (short) to a file.

WriteInt32

Writes a single int32 (int/cell) to a file.

WriteInt8

Writes a single int8 (byte) to a file.

WriteLine

Writes a line of text to a text file. A newline is automatically appended.

WriteString

Writes a binary string to a file.

Properties 1

Name Type Description
Positionint

Get the current position in the file; returns -1 on failure.