A.47 library(settings): Setting management
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(settings): Setting management
          • setting/4
          • setting/2
          • env/2
          • env/3
          • set_setting/2
          • restore_setting/1
          • set_setting_default/2
          • load_settings/1
          • load_settings/2
          • save_settings/0
          • save_settings/1
          • current_setting/1
          • setting_property/2
          • list_settings/0
          • list_settings/1
          • convert_setting_text/3
    • Packages
Availability::- use_module(library(settings)).(can be autoloaded)
Source[det]load_settings(File)
[det]load_settings(File, +Options)
Load local settings from File. Succeeds if File does not exist, setting the default save-file to File. Options are:
undefined(+Action)
Define how to handle settings that are not defined. When error, an error is printed and the setting is ignored. when load, the setting is loaded anyway, waiting for a definition.

If possibly changed settings need to be persistent, the application must call save_settings/0 as part of its shutdown. In simple cases calling at_halt(save_settings) is sufficient.