FILE_WRITEBUF

FILE_WRITEBUF N,E,C

WRITES C CHARACTERS OF THE EXPRESSION E TO THE TEXT FILE NUMBER N

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

ACTION

The command FILE_WRITEBUF N,E,C writes C characters of the string expression E to the text file number N. E is a string expression (string varaiable or string of characters or mix of string and variable). If C is greater than the number of characters in E, all the characters of E are written then spaces (character SPACE) are written to get a total number of C characters.

SYNTAX: FILE_WRITEBUF N,E,C

  • N = file number (integer or real). Must be greater than 0 and less than or equal to the maximum of allowed text file number.
  • E = string expression.
  • C = number of characters to be written to the file.

USE

  • The command FILE_WRITEBUF is used to write a certain number of characters 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 E is not a correct string expression.
  • If C is not a correct expression.
  • If C is less than or equal to 0.

EXAMPLE

rem open a file for writing

file_open_write 1,"my_file.txt"

rem write 8 characters

file_writebuf 1,"abcdefghijkl",8:rem "abcdefgh" is written

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_WRITELN