FILEBIN_HEXA_READ$()

FILEBIN_HEXA_READ$(N,C)

RETURNS C BYTES READ FROM THE BINARY FILE NUMBER N

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

ACTION

The function FILEBIN_HEXA_READ(N,C) returns a block of C bytes read from the binary file number N. The returned value is 2xC hexadecimal characters.

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

SYNTAX: Result$=FILEBIN_HEXA_READ$(N,C)

  • N = number of binary file (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.
  • Result$ is a string.

USE

  • The function 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

v$=filebin_hexa_read$(1)

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