RTI_GET_CFG function
Description
Returns the most-specific configuration record information from the specified table (default SYSENV)
Syntax
config_info = RTI_GET_CFG(cfg_id [,cfg_table] [,layout_id] [,which_field])
Parameters
The RTI_GET_CFG function has the following parameters.
Parameter | Description |
---|---|
cfg_id | Specifies the configuration record to retrieve. Those provided by Revelation Software will start with CFG_ (for example, CFG_OIPI) |
cfg_table | (Optional) The table where the configuration record is stored. If you do not specify cfg_table, the default table is SYSENV. |
layout_id | (Optional) Layout records are used by the configuration maintenance screens to dynamically build the prompts, provide defaults, etc. for those screens. They are normally named LAYOUT_cfg_id (for example, LAYOUT_CFG_OIPI). If specified here, the layout record will be used to fill in default values. |
which_field | (Optional) The specific field number (or field and value number, specified as <field_number>.<value_number>) of the configuration record to return. If layout_id is specified, then which_field may be a field name as defined in the layout record. |
Returns
The value in the specified configuration record. The function will look in the specified cfg_table (or SYSENV if not specified) for the record named cfg_id*<current_appid>*<current_userid>. If not found, the configuration table is checked for a record named cfg_id**<current_userid> (the "user specific" configuration record). If not found, the configuration table is checked for a record named cfg_id*<current_appid> (the "app specific" configuration record). Finally, if still not found, the configuration table is checked for a record named cfg_id (the "global" configuration record).
If layout_id is specified, then the SYSENV record LAYOUT_cfg_id will be used to fill in any empty fields of the configuration record with the appropriate default values.
If which_field is not specified, the entire record is returned; if which_field is a numeric value, then that field number is returned (it may also be specified as "field_number.value_number" to return only a specifid value). If both layout_id and which_field are specified, then which_field may refer to a field name defined in the layout record.
Notes
RTI_GET_CFG will cache any configuration records that it retrieves. If you wish to force the record to be re-read from disk, prefix the cfg_id with an exclamation mark (ie, "!CFG_OIPI").
Example
oipi_settings = RTI_GET_CFG("CFG_OIPI") ;* read the most-specific record from SYSENV