CAPL Script

GetProFileString

Note A file name must be passed to this function. The absolute file name is determined by means of asearch procedure.

Syntax

long getProfileString(char section[], char entry[], char def[], char buff[], long buffsize, char filename[]); // form 1

long getProfileString(char section[], char entry[], char def[], char buff[], long buffsize, char filename[], dword utf16); // form 2

Function

Searches the filefilenameundersectionsection for the variableentry. Its contents (value) are written to the bufferbuff. Its length must be passed correctly inbuffsize. If the file or entry is not found, the default valuedefis copied to buffer. If the read string length is longer than the buffer, the string will be cut to the buffer length.

Parameters

section Section of the file as a string.

entry

Variable name as a string.

def

Default value in case of error as a string.

buff

Buffer for the read-in character as a string.

buffersize

Size ofbuffin bytes (max. 1022 characters).

filename

File name as a string.

utf16

If this flag is set the file will be interpreted as UTF-16LE encoded, if the corresponding BOM is also present. The string written tobuffwill be converted to the CAPL encoding.

Return Values

Length of the read string.

Length of the default string: Fault Key not found

-1: Fault File not found

Example