FILE_WRITELN

FILE_WRITELN N,S

WRITES THE LINE S TO THE TEXT FILE NUMBER N

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

ACTION

The command FILE_WRITELN N,S writes a line to the text file number N, the line being in the variable S, or in the string expression S.

The next writing in The file will be at the next line.

Example :

file_writeln 1,Ab3(6) (variable belonging to a real array)

file_writeln 1,A$+B$ (string expression)

file_writeln 1,"Hello !"

SYNTAX: FILE_WRITELN 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 = variable name, or string expression.

USE

  • The command FILE_WRITELN is used to write one line to 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 not used for an open text file.
  • If S is not a correct expression.
  • If S is not a declared variable.

EXAMPLE

rem open a file for writing

file_open_write 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_APPEND

FILE_OPEN_READ

FILE_OPEN_WRITE

FILE_READ

FILE_READBUF

FILE_READLN

FILE_READLN$()

FILE_WRITE

FILE_WRITEBUF