CAPL Script

Open

Note A filename must be passed to this function. The absolute filename is determined by means of a search procedure. First a search is made to determine whether the given file is located in a directory of the databases. If the desired file is not found the active configuration directory is used.

Syntax

file(char [] filename, dword access, dword mode); // form 1

file(char [] filename, dword access, dword mode, dword fileEncoding); // form 2

Method(Dynamic)

long File::Open(char filename[], dword access, dword mode); // form 1

long File::Open(char filename[], dword access, dword mode, dword fileEncoding); // form 2

Function

This function opens the file named filename. If access = 0, the file is opened for write access;if access = 1 the file is opened for read access. If mode = 0 the file is opened in text mode;if mode = 1 the file is opened in binary mode.

Parameters

filename The name of the file

access

0 for write access, 1 for read access

mode

0 for
text mode, 1 for binary mode

fileEncoding

Identifier of theMicrosoftcode page that is used to encode the file.

Return Values

— (constructor)

Class: File