ssCore.INIFile.getVal

Retrieve a value from the specified section and key of an INI file.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

path - A fully qualified path to the INI file. This parameter supports monikers.

section - Name of the section containing the key to read.

key - Name of the key to read.

defaultValue - [Optional] - If the specified key doesn't exist in the INI file, this value will be returned in the resultvar. You should use a defaultValue that is different from what you expect to be returned (to help identify retrieval problems).


Output Parameters:

result - The requested value from the INI file or the defaultValue string. The defaultValue is returned if the requested key does not exist or in the case of an error.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.INIFile.getVal( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.INIFile.getVal( paramsObject );


Notes:

Do not include the enclosing square brackets ("[" and "]") in the section name argument.

                

Examples:

var return_obj = ssCore.INIFile.getVal({path:"startdir://settings.ini", section:"Window", key:"width", defaultValue:"?"});

ssDebug.trace(return_obj.result);