OpenPreferences()

Syntax

Result = OpenPreferences(FileName$)
Description
Open a previously existing preference file. If 'Result' is 0 then the file can't be opened or wasn't found. Nevertheless, if the file wasn't found, the programmer can still use the the read commands and it will return always the specified default value, very useful to initialize in one step the program variables. The commands like ReadPreferenceString() can be used to read the preference values stored in the file.

To remove a key or a group, the commands RemovePreferenceKey() and RemovePreferenceGroup() are available. To create or change the current group, use PreferenceGroup(). It is possible to change existing values with WritePreferenceString() and similar commands.

Once all operations have been done, ClosePreferences() is used to write effectively the preference file back to disk (if it has been modified in between).

Supported OS

Windows, Linux, MacOS X

<- NextPreferenceKey() - Preference Index - PreferenceComment() ->