CAPL Script

OpenFileWrite

Note Before this function can be called the writepathmust be set by the functionSetWritePath. Otherwise the configuration directory will be used. A relative file name must be passed to the function.

Syntax

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

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

Function

This function opens the file namedfilenamefor the write access. If mode=0 writing can be executed in text mode;if mode=1 writing can be executed in binary mode. An already existing file will be overwritten. mode=2 to append data at the end of the file use for text mode.mode=3 to append data at the end of the file for binary mode.

Parameters

filename file name

mode

fileEncoding

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

Return Values

The return value is the file handle that must be used for write operations. If an error occurs, the return value is 0.

Example