|
ReadTextFile() 
Reads the contents of a disk file as a character
string or array list.
Syntax
ReadTextFile(<cFilename>,
<[lAsArrayList]>) --> cString
Arguments
<cFilename> --> Is the name of the file
to read from disk. If a path is not specified CAPITAL checks the
default company folder, then the main CAPITAL data folder and then
the CAPITAL program folder.
<lAsArrayList> --> If this optional
parameter is specified, the file is returned as an array list of
character lines.
Returns
The contents of the text file is returned as a
character string up to 64K (65,536 bytes) in length or an array
list of up to 4000 character strings for CAPITAL Series 7. There
are no file size restrictions with CAPITAL V8.
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 or the 4000 line limit for CAPITAL Series 7. If the file to
read in exceeds the maximum file size the string returned will
contain the text: "***FILE TOO LARGE***". If you are returning an
array list, only the first 4000 lines will be returned if the file
exceeds 4000 lines in size.
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
Business
Function List
WriteTextFile()
|