gemus_script_reference:functions:set_cfg_item
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | gemus_script_reference:functions:set_cfg_item [2023/10/04 14:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Back to [[.:|Script Function Reference]] | ||
+ | ====== Set_CFG_Item() ====== | ||
+ | |||
+ | The Set_CFG_Item() function can be used for manipulating configuration files. You can set single values, or keys and values with a specific delimeter. If you only need to set keys and values (in the form // | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | < | ||
+ | |||
+ | ===== Arguments ===== | ||
+ | |||
+ | ^ Argument ^ Required ^ Description ^ | ||
+ | | // | ||
+ | | //key// | Yes | The key within the configuration file that you want to set. Any [[..: | ||
+ | | // | ||
+ | | //value// | No | The desired value pertaining to //key// that you want to set. If this parameter is omitted (left blank) then only the //key// will be written to the ini file, without the // | ||
+ | \\ | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | < | ||
+ | Set_CFG_Item(%emupath%\config.cfg||MODE||: | ||
+ | </ | ||
+ | The line in the config file would look something like this: -\\ | ||
+ | MODE: | ||
+ | |||
+ | < | ||
+ | Set_CFG_Item(1||$LOADPATH||%tab%||%gamepath%) | ||
+ | </ | ||
+ | The line in the config file would look something like this: -\\ | ||
+ | $LOADPATH | ||
+ | |||
+ | < | ||
+ | Set_CFG_Item(2||ControlPort2||||) | ||
+ | </ | ||
+ | The line in the config file would look something like this: -\\ | ||
+ | ControlPort2 | ||
+ | |||
+ | ===== Remarks ===== | ||
+ | |||
+ | * If the key cannot be found in the specified configuration file it will be created and set to the specified value (if supplied). | ||
+ | * When the script is executed, a warning message will be displayed if the file cannot be found. | ||
+ | |||
+ | ===== See Also ===== | ||
+ | |||
+ | * [[.: | ||
+ | * [[.: | ||
+ | * [[.:|Script Function Reference]] |
gemus_script_reference/functions/set_cfg_item.txt · Last modified: 2023/10/04 14:15 by 127.0.0.1