Most files in CSPro are data files, whose structure is defined by a data dictionary are are used in logic by referring to their dictionary names. However, it is also possible to write to text files without an associated data dictionary. Lines of text can be written to a file or read from a file, and these files can also be used in
export statements.
The physical name of the file can be specified in the Define File Associations dialog when the application is run, in a
PFF file, or by using the
File.open,
open, or
setfile functions.
A File is a CSPro logic object and the following functions can be called via
dot notation:
Function | Description |
open | Associates the File object with an existing or a new file on the disk (equivalent to setfile). |
close | Closes the open file (equivalent to close). |
read | Reads one or more lines of text from the file (equivalent to fileread). |
write | Writes one or more lines of text to a file (equivalent to filewrite). |
|
getLabel | Returns the symbol's label. |
getName | Returns the symbol's name. |
getJson | Returns the symbol's metadata and value represented in JSON. |
getValueJson | Returns the symbol's value represented in JSON. |