Function: config

Syntax

config( <string> {,<num>} )

Type

string

Returns

The string value from the System Configuration File (or program parameter) corresponding to a key supplied by the caller. The format of a line in the configuration file is:

<key> <value>

Example:

name1 Fred

The configuration file is named fire.ini.

If the key was used as a program parameter switch, then its value will be returned to the config function in preference to that from the configuration file,

Example:

fire -name1=Fred

Parameters

config("name1") - Might yield 'Fred'
config("nam") - would yield 'Fred'
config("nam",1) - would fail

A successful execution of this function will return the value associated with the keyword. For an entry in the config file, the return value is whatever follows the the keyword on the config file line, which may be an empty string. For a program parameter, if the keyword has no accompanying value, e.g. -g rather than -g=<value>, then the string value "1" is returned, or "0" if the keyword was of the form -no_<keyword>, e.g. -no_g. This enables boolean values to be provided as command line parameters.

An unsuccessful execution of the function will return an empty string and set the value of funcerr to -1.

Examples

The following might yield 'Fred'.

string cs = config("name1")