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 functions and it will return always the specified default value, very useful to initialize in one step the program variables. The functions like ReadPreferenceString() can be used to read the preference values stored in the file.

To remove a key or a group, the functions 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 functions.

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

All

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