gemus_script_reference:functions:set_cfg_value
Back to Script Function Reference
Set_CFG_Value()
The Set_CFG_Value() function can be used for manipulating configuration files by setting key=value pairs. If you need more control over what is written to the configuration file, see Set_CFG_Item(). If you need to set values in a standard Windows INI file ([sections] containing key=value pairs), see Set_INI_Value().
Syntax
Set_CFG_Value(filenum/filename||key||value)
Arguments
Argument | Required | Description |
---|---|---|
filenum/filename | Yes | The number of the file set in the script's associated files list that you want write to, or the absolute path\filename you want to write to. If you are using an absolute path\filename, any script environment variables found in filename will be replaced by their actual values when the script is executed. |
key | Yes | The key within the configuration file that you want to set. Any script environment variables found in key will be replaced by their actual values when the script is executed. |
value | No | The desired value pertaining to key that you want to set. Any script environment variables found in value will be replaced by their actual values when the script is executed. |
Examples
Set_CFG_Value(%emupath%\config.cfg||$LOADPATH||%gamepath%)
The line in the config file would look something like this: -
$LOADPATH=c:\games
Set_CFG_Value(4||MODE||Windowed)
The line in the config file would look something like this: -
MODE=Windowed
Set_CFG_Value(4||MODE||)
The line in the config file would look something like this: -
Mode=
Remarks
- If the key cannot be found in the specified configuration file it will be created and set to the specified value.
- When the script is executed, a warning message will be displayed if the file cannot be found.
See Also
gemus_script_reference/functions/set_cfg_value.txt · Last modified: 2023/10/04 14:15 by 127.0.0.1