FILEBIN_HEXA_READ

FILEBIN_HEXA_READ N,C,V$

READS C BYTES FROM THE BINARY FILE NUMBER N AND STORES THE VALUES TO THE VARIABLE V

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

ACTION

The command FILEBIN_HEXA_READ N,C,V reads a block of C bytes from the binary file number N and stores the read values on the shape of 2xC hexadecimal characters to the variable V.

The current position in the binary file is increased by C.

SYNTAX: FILEBIN_HEXA_READ N,C,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.
  • C = bytes number, of type integer or real.
  • V = name of variable array, of type string.

USE

  • The command FILEBIN_HEXA_READ is used to read a block of bytes from a 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 C is not a correct expression.
  • If C is less than 1.
  • If V is not a declared variable.
  • If V is not a variable of type string.

EXAMPLE

dim v$

rem open a binary file for reading

filebin_open_read 1,"file.abc"

rem set the position to 5

filebin_position 1,5

rem read 10 bytes

filebin_hexa_read 1,10,v$

rem print the 10 read bytes

print v$

rem close the binary file

filebin_close 1

SEE ALSO

FILEBIN_BLOCK_READ

FILEBIN_BLOCK_WRITE

FILEBIN_CLOSE

FILEBIN_HEXA_READ$()

FILEBIN_HEXA_WRITE

FILEBIN_OPEN_READ

FILEBIN_OPEN_WRITE

FILEBIN_POS()

FILEBIN_POSITION

FILEBIN_READ

FILEBIN_READ()

FILEBIN_SIZE()

FILEBIN_WRITE