ReadTextFile()
Reads the contents of a disk file as a character string.
Syntax
ReadTextFile(<cFilename>) --> cString
Arguments
<cFilename> --> is the name of the file to read from disk. If a path is not specified CAPITAL checks the default company directory, then the main CAPITAL data directory and then the CAPITAL program directory.
Returns
The contents of the text file is returned as a character string up to 64K (65,536 bytes) in length.
Description
This function is used to read the contents of a disk file. The file is opened, its contents read in, and the file is closed again.
The file to read in must not exceed the 64K limit. If the file to read in exceeds the maximum file size the string returned will contain the text: "***FILE TOO LARGE***".
If the file is not found an error message is raised and an empty string ("") is returned. Use the IsFile() function to determine if the file exists before attempting to read its contents.
____________________________
Related Topics: