when i use the following to create the preference file with some groups and keys/values
Code: Select all
Procedure createPrefs()
CreatePreferences(GetCurrentDirectory()+"Preferences.prefs")
PreferenceGroup("Global")
WritePreferenceString("ApplicationName", "maya Batch")
PreferenceGroup("Paths")
WritePreferenceString("mayaPath", "")
ClosePreferences()
EndProcedure
[Global]
ApplicationName = maya Batch
[Paths]
mayaPath =
then if i update one of the keys values in the paths group - using the following
Code: Select all
Procedure updatePrefs()
If CreatePreferences(GetCurrentDirectory()+"Preferences.prefs")
PreferenceGroup("Paths")
WritePreferenceString("mayaPath", mayaPath$)
ClosePreferences()
EndIf
EndProcedure
[Paths]
mayaPath = C:\Program Files\Autodesk\Maya2019\bin\
it is blowing away the other group [Global] and its keys, also if i have more than 1 key in the paths group and update one of the keys the other key gets blown away as well
i have only been using purebasic for a couple of hours so its probably a newbie issue - but would liek to get some help on were i am going wrong.
cheers
Arthru
// Code Tags added (Kiffi)