FILEBIN_READ

FILEBIN_READ N,V

READS ONE BYTE FROM THE BINARY FILE NUMBER N AND STORES ITS VALUE TO THE VARIABLE V

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

ACTION

The command FILEBIN_READ N,V reads one byte from the binary file number N and stores its value to variable V.

The variable V must be of the type integer or real.

The current position in the binary file is incremented by 1.

SYNTAX: FILEBIN_READ N,V

  • 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.
  • V = name of variable, of type integer or real.

USE

  • The command FILEBIN_READ is used to read one byte from 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 not used for an open binary file.
  • If V is not a declared variable.
  • If V is not a variable of type integer or real.

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_READ

FILEBIN_OPEN_WRITE

FILEBIN_POS()

FILEBIN_POSITION

FILEBIN_READ()

FILEBIN_SIZE()

FILEBIN_WRITE