Loading...
 

Open

Open

Open(fileName, mode), Open(fileName)

parameters: Filename, Mode

Stack
Stack Position Description
Stack(In) Top -
Stack(Out) Top -

or Open(, mode), Open

Stack
Stack Position Description
Stack(In) Top Filename as string
Stack(Out) Top -

A text file (ASCII file) is opened. With the instructions Read and Write, this file can then be sequentially read or written to. The file name is fixed in the first parameter or taken from the stack (in the latter case FileDlg can be used for interactive input). If the file name contains 'CX_ROOTDIR\', 'CX_ROOTDIR' is replaced by:

  • the path specified with the environment variable 'CX_ROOTDIR' or
  • with '\CLASSIX' if the environment variable does not exist.

In the second parameter one of the following modes (as a character string) must be specified:

"r" opens a file for reading (standard acceptance)
"w" opens a file for writing
"a" write to the end of an already existing file

Note: An existing file with the same name is deleted in "w" mode.

Instruction Open corresponds to the function fopen of the C standard library.