WriteLine()

Summary

Writes a string of characters to a text file.

Syntax

WriteLine(file f, string line)

Argument Contents
f The handle of the file
line The string to be written

Notes

  • WriteLine() adds a carriage return to the text file at the end of the string.

  • While ReadLine() is limited to reading strings of 5119 characters, WriteLine() has no such limit for writing strings.

Example

ptr = OpenFile("lisfile.txt", "a")
WriteLine(ptr, "Add this line to the file")

Error Codes

Error Type Meaning
Error File is not open, is open in read-only mode, or is a binary file

See Also

Function Summary
CloseFile() Closes a file
ReadLine() Reads a string of characters from a text file
OpenFile() Opens a text or binary file on disk