Lexmark Document Distributor User Manual page 40

Lexmark document distributor software: user guide
Hide thumbs Also See for Document Distributor:
Table of Contents

Advertisement

TextFiles
The TextFile helper object manipulates files containing alphanumeric text. The TextFile helper object
cannot be used to access images files, word processor files, or other types of files. The TextFile object
can read from an existing text file or write text to a new file.
These are the basic methods used to access a TextFile object.
Open
There are two open methods. The difference in the methods is how the text file to be opened is
specified. If the file is successfully opened, the Open method returns a value of TRUE; otherwise it
returns a value of FALSE.
Method
bool Open(string file, bool bCreate)
bool Open(doc doc1)
Read and Write
You must use one of the open methods before you can read from, or write to, a text file.
Methods
string ReadLine()
bool WriteLine(string line)
End of File
There are two methods to help determine how much information is contained in the text file.
Methods
int GetNumberLines()
bool EOF()
Close the Textfile
The opened text file must be closed when you are finished using it.
Methods
void Close()
Parameters
string file—Full path name of the file to open
bool bCreate—If TRUE the file will be created if it does not already
exist.
doc doc1—Specifies the document object containing the text file.
Opens the first file in the document object. This is especially useful
for accessing the results of Actions that return a document object.
Parameters
Returns the next line of the text file with the terminating new line
character removed.
string line—String to be written to the current position of the file. A
new line character is appended to the file after this string
Parameters
Returns the number of lines contained in the text file
Returns TRUE if the end of file has been reached. Returns FALSE
otherwise.
Parameters
Closes the file associated with the helper object.
36

Advertisement

Table of Contents
loading

Table of Contents