# IupConfigGetVariableInt

Definition: | include pGUI.e integer res = IupConfigGetVariableInt(Ihandle config, string group, string key, integer def=0) -- or -- integer res = IupConfigGetVariableIntId(Ihandle config, string group, string key, integer id, integer def=0) -- or -- atom res = IupConfigGetVariableDouble(Ihandle config, string group, string key, atom def=0) -- or -- atom res = IupConfigGetVariableDoubleId(Ihandle config, string group, string key, integer id, atom def=0)
Description: | This function is similar to the IupGetInt function, but persistent and optionally with a default. config: Identifier of the configuration database (see IupConfig) group: group name of the variable key: key name of the variable id: used when the variable has a sequential number def: default value of the variable The group and key names should be arbitrarily selected by the programmer to be meaningful and unique across the application, just as you would if you were writing out a .ini file by hand. For example "MainWindow", "FontSize", 12 should result in a config file that contains, amongst other things, "[MainWindow]\nFontSize=12\n". Internally variables are stored as attributes using a "<GROUP>.<KEY>" combination, which is why group and key names cannot have periods ".". Returns: the variable value or the contents of def if the variable is not set or does not exist.
pwa/p2js: | Not supported.
Notes: | The IupConfigGetVariableXxxx[Id]Def C functions can be replaced with the pGUI functions without the trailing "Def".
Example: |
    if IupConfigGetVariableInt(config, "MainWindow", "Toolbar", 1) then
        -- <show the toolbar>
    end if
See Also: | IupConfig, IupConfigLoad, IupGetAttribute