FILEBIN_BLOCK_WRITE

FILEBIN_BLOCK_WRITE N,C,V%(P)

WRITES C BYTES TO THE BINARY FILE NUMBER N, DATA TO BE WRITTEN ARE IN THE ARRAY V% FROM INDEX P

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

ACTION

The command FILEBIN_BLOCK_WRITE N,C,V%(P) writes a block of C bytes to the binary file number N. The data to be written are in the array V% from index P.

The array V% must be of the type integer.

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

SYNTAX: FILEBIN_BLOCK_WRITE N,C,V%(P)

  • 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.
  • V% = name of variable array, of type integer.
  • C = bytes number, of type integer or real.
  • P = array index, of type integer or real.

USE

  • The command FILEBIN_BLOCK_WRITE is used to write a block of bytes to 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 P is not a correct expression.
  • If P is less than 1.
  • If the size of V%() is not greater than or equal to P+C-1.
  • If V% is not a declared variable.
  • If V% is not a variable of type array integer.
  • If the values of V%(P) to V%(P+C-1) are not between 0 and 255.

EXAMPLE

rem open a binary file for writing

filebin_open_write 1 1,"file.abc"

rem set the position to 5

filebin_position 1,5

rem write 10 bytes

filebin_block_write 1,10,v%(7)

rem close the binary file

filebin_close 1

SEE ALSO

FILEBIN_BLOCK_READ

FILEBIN_CLOSE

FILEBIN_HEXA_READ

FILEBIN_HEXA_READ$()

FILEBIN_HEXA_WRITE

FILEBIN_OPEN_READ

FILEBIN_OPEN_WRITE

FILEBIN_POS()

FILEBIN_POSITION

FILEBIN_READ

FILEBIN_READ()

FILEBIN_SIZE()

FILEBIN_WRITE