FILEBIN_OPEN_READ

FILEBIN_OPEN_READ N,S

OPENS A BINARY FILE FOR READING, WITH NUMBER N AND NAME S

  • Type: Command
  • Parameters: 2
  • Group: Binary Files

ACTION

The command FILEBIN_OPEN_READ N,S opens an existing binary file named S, and gives it the file number N. The number N will be used to designate the binary file.

The open file can then be used through the appropriated commands.

SYNTAX: FILEBIN_OPEN_READ N,S

  • N = binary file number (integer or real). Must be greater than 0 and less than or equal to the maximum of allowed binary file number.
  • S = string. Absolute or relative file name.

USE

  • The command FILEBIN_OPEN_READ is used to open for reading an existing binary file.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the maximum of allowed binary file number.
  • If number N is already used for an open binary file. (closing a file releases its number)
  • If S is not a correct file name.
  • If the binary file named S does not exist.

EXAMPLE

dim v%

rem open a file for reading

filebin_open_read 1,"test"

rem read the first byte

filebin_read 1,v%

rem print the read value

print v%

rem close the file

filebin_close 1

SEE ALSO

FILEBIN_BLOCK_READ

FILEBIN_BLOCK_WRITE

FILEBIN_CLOSE

FILEBIN_HEXA_READ

FILEBIN_HEXA_READ$()

FILEBIN_HEXA_WRITE

FILEBIN_OPEN_WRITE

FILEBIN_POS()

FILEBIN_POSITION

FILEBIN_READ

FILEBIN_READ()

FILEBIN_SIZE()

FILEBIN_WRITE