FILEBIN_OPEN_WRITE

FILEBIN_OPEN_WRITE N,S

CREATES A BINARY FILE FOR WRITING, WITH NUMBER N AND THE NAME S

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

ACTION

The command FILEBIN_OPEN_WRITE N,S creates a new binary file named S and gives it the file number N. The number N will be used to designate the binary file.

The created binary file can then be used through the appropriated commands.

Remark: if an existing file has the same name S, it is cancelled (then lost) and replaced by the new one.

SYNTAX: FILEBIN_OPEN_WRITE N,S

  • 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.
  • S = string. Absolute or relative file name.

USE

  • The command FILEBIN_OPEN_WRITE is used to write in 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 already used for an open binary file. (closing a file releases its number)
  • If S is not a correct file name.

EXAMPLE

rem open a binary file for writing

filebin_open_write 1,"test"

rem write the value 40

filebin_write 1,40

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_POS()

FILEBIN_POSITION

FILEBIN_READ

FILEBIN_READ()

FILEBIN_SIZE()

FILEBIN_WRITE