FILE_OPEN_APPEND

FILE_OPEN_APPEND N,S

OPENS A TEXT FILE TO WRITE AFTER ITS LAST LINE, WITH NUMBER N AND NAME S

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

ACTION

The command FILE_OPEN_APPEND N,S opens an existing text file named S and gives it the file number N. The number N will be used to designate the file.

The open text file can then be used through the appropriated commands.

The content of the file is kept and all the writings (with the commands FILE_WRITE, FILE_WRITEBUF or FILE_WRITELN) are performed after the last line.

SYNTAX: FILE_OPEN_APPEND N,S

  • N = file number (integer or real). Must be greater than 0 and less than or equal to the maximum of allowed text file number.
  • S = string. Absolute or relative file name.

USE

  • The command FILE_OPEN_APPEND is used to write after the last line of a text file.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the maximum of allowed text file number.
  • If number N is already used for an open text file. (closing a file frees its number)
  • If S is not a correct file name.

EXAMPLE

rem open a text file for writing after its last line

file_open_append 1,"my_file.txt"

rem write a line

file_writeln 1,"Hello !"

rem close it

file_close 1

SEE ALSO

FILE_CLOSE

FILE_EOF()

FILE_OPEN_READ

FILE_OPEN_WRITE

FILE_READ

FILE_READBUF

FILE_READLN

FILE_READLN$()

FILE_WRITE

FILE_WRITEBUF

FILE_WRITELN