Name
ReadShort -- read 16-bit integer from a file (V2.0)
Synopsis
short = ReadShort(id[, flags])
Function
This function reads a 16-bit integer from the file specified by id and returns it. Reading starts from the current file cursor position which you can modify using the Seek() command. Since ReadShort() reads a 16-bit integer from the file, the file cursor will be advanced by 2 bytes.

The flags parameter may be a combination of the following flags:

#IO_UNSIGNED:
The return value will be unsigned and will range from 0 to 65535. This is the default.

#IO_SIGNED:
The return value will be signed and will range from -32768 to 32767.

#IO_LITTLEENDIAN:
By default, this function expects the data to be stored in big endian format (most significant byte first). You can set this flag to request this function to use the little endian format instead.

Inputs
id
file to read data from
flags
optional: additional flags (see above) (defaults to #IO_UNSIGNED) (V9.0)
Results
short
short value read from file

Show TOC