This class wraps file I/O. Currently, this class only supports simple sequential file manipulation, but it may be extended in a future version.
Words in italics indicate an instance of a class. The word corresponds to the class name, except where more than one instance is represented in the same statement. In that case a number (2, 3, etc.) is appended to the class name.
Words in normal typeface are to be taken literally (required punctuation, class name in a static reference, method name, etc.)
The symbol => is used to separate an expression (on the left) from its return value (on the right).
An ellipsis (...) indicates that the previous argument may be repeated any number of times. The description will indicate whether one instance is required.
file.channel => int
file.Close()
This method closes the file. It is called automatically by the destructor, but on .NET you may wish to call it explicitly, because you cannot know when the destructor will be invoked. If called more than once, no error results.
If the UI Toolkit was used to open this file (see Open), then the UI Toolkit routine U_CLOSE will be used to close it.
file.Display(a)
This method writes raw text to file, without any line terminator.
If the mode of the file is incompatible with a variable-length write, or if some other error occurs, a catchable exception will result.
file.mode => a
file.name => a
File.Open(a) => file
File.Open(a, a2) => file
new File(a) => file
new File(a, a2) => file
Instantiates a new File object and opens the file named a. If a2 is passed, it specifies the I/O mode. Otherwise, "I" is assumed.
If the UI Toolkit is active, this method uses U_OPEN to open the file, and U_GBLCHN to prevent the UI Toolkit from closing it before this object goes out of scope. If the UI Toolkit is not active, this method seeks out an open channel and opens it directly.
If an error occurs when opening the file, a catchable exception will result.
file.ReadLine() => string
file.ReadLines() => ls
file.WriteLine(object)
This method writes sequentially to file. If object is an ArrayList (or derived from ArrayList -- e.g., ls), then each member's string representation (obtained by calling its ToString() method) is output as a separate line. For any other type of object or primitive (a, int, decimal), the string representation of that argument is output as a separate line.
If the mode of the file is incompatible with a sequential write, or if some other error occurs, a catchable exception will result.