WRITEFILE Write string to specified text file |
Top Previous Next |
This script command writes characters to the specified text file. This command is oriented toward writing a complete record of printable characters, terminated by a carriage-return/ line-feed, to a file. The scope of this command (and the READFILE command) is not to provide full function file I/O to your script files, but rather to provide temporary storage for small amounts of information for use by a script file or an external program.
By default WRITEFILE either creates a new file or over-writes an existing file with what is written. You may use the /append option add records an existing file.
Consider the following example.
;; write a string received from the COM port to a file LINEIN user_id /timeout=0 WRITEFILE "user_info.txt" user_id /append
Note: The %crlf internal variable is available for adding additional line breaks to your output string.
Related Command(s): READFILE, LINEIN, LINEOUT, WORKINGDIR
|