File Commands SECTION 6 Functions and Methods
81
Typical Example
FileName = "TEST.TXT"
Exists = FileExists(FileName)
The Boolean point 'Exists' is set to 'TRUE' if a file called 'C:\TEST.TXT' exists.
6-9-5 MoveFile
Syntax
returnstate = MoveFile("sourcename", "destname")
Remarks
Typical Example
MoveFile("c:\autoexec.bat", "c:\autoexec.old")
The file "c:\autoexec.bat" is moved to the file "c:\autoexec.old".
6-9-6 OpenFile
Syntax
returnstate = OpenFile("filename")
Remarks
Typical Example
OpenFile("c:\filename")
The file "c:\filename.csf" is opened and able to be accessed by the Read() and
Write() script commands. Only one file can be open at a time. A file is created
if it doesn't already exist. Files can be shared (for instance located on a
network drive, and accessed by several running CX-Supervisor applications
simultaneously - this can be used for data exchange).
6-9-7 PrintFile
Syntax
returnstate = PrintFile("filename")
Remarks
Argument Type Description
filename string This text string contains the file name.
returnpoint point Boolean point that contains the return value.
Note: "FileName" is a text point which can be set to any string value.
Argument Type Description
returnstate bool Returnstate is '1' if the function is successful, or
'0' otherwise.
sourcename string Pathname of file to be moved.
destname string Pathname of destination of move.
Argument Type Description
returnstate bool Returnstate is '1' if the function is successful, or
'0' otherwise.
Filename string Pathname of file to be opened.
Note: An extension ".csf" will always be added to the filename so it must not be
specifed as part of the argument.