LogiView

Function 'open'

     

This function opens the specified file with the corresponding access on the server.

It returns the Id, that must be assigned to a (integer) variable. In all subsequent operations (for example reading, writing, or closing) the file is addressed by means of this ID.

The number of files that can be open at the same time is only limited by parameters of the operating system, and not by LogiView.

This function cannot be called as a conditional instruction.
 

Syntax:

  {INT_VAR}= open({STR_EXPR},{"r","w","a"},{/ENC=STR_ENC})
 

I/O parameters:

{STR_EXPR} Name of the file to be opened (including path information according to the syntax of the operating system).
{"r","w","a"}
"r" Open file with read access.
"w" Open file with write access.
"a" Add; open file for writing at the end of file or create new file.
{/ENC=STR_ENC}

Optional parameter to specify the encoding to open a file.

If /ENC is not set, the value from configuration parameter EDB-CHR-ENC is used.

If /ENC=STR_ENC and the configuration parameter EDB-CHR-ENC are not specified, the system will use the default encoding.

-  
 

Return value:

 
{INT_VAR} ID
 

Example:

  Declaration of Variables
 
 10 DOCU_INT_1 = open("\tmp\test.doc","r")
  Result:
  The file "test.doc" is opened on the server in the "tmp" directory. If the "tmp" directory does not exist or the file cannot not be opened, an error message is displayed and the processing is stopped.
 

Functions and commands: File Interface