FILEBIN_POSITION

FILEBIN_POSITION N,P

CHANGES THE CURRENT POSITION IN THE BINARY FILE NUMBER N

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

ACTION

The command FILEBIN_POSITION N,P set to P the current position of the binary file number N. The first position in a binary file is 0.

SYNTAX: FILEBIN_POSITION N,P

  • 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.
  • P = new position (integer or real).

USE

  • The command FILEBIN_POSITION is used to read or to write in any position of 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 P is not a correct expression.
  • If P is less than 0.

EXAMPLE

dim v%

rem open a binary file for reading

file_open_read 1,"test"

rem read the byte in position 4

filebin_position 1,4

filebin_read 1,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_READ

FILEBIN_READ()

FILEBIN_SIZE()

FILEBIN_WRITE