How to change Preference file value?

Just starting out? Need help? Post your questions and find answers here.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

How to change Preference file value?

Post by Mythros »

Hi all! How do you edit a value after having written a Preferences.pref file?

ANY help as always is GREATLY appreciated!

Thank You! <3
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: How to change Preference file value?

Post by Josh »

Help wrote: WritePreference...()

Creates or changes the specified key and its associated ...
sorry for my bad english
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: How to change Preference file value?

Post by Mythros »

Ok, so it's safe just to keep writing? But the problem is I need to change one simple value. not the whole file.

Thank You! <3
dibor
Enthusiast
Enthusiast
Posts: 162
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: How to change Preference file value?

Post by dibor »

Mythros wrote:I need to change one simple value
Hi.
What value?
If Integer - WritePreferenceInteger(Key$ , Value)
If Float - WritePreferenceFloat(Key$ , Value.f)

Please look in the help file, there shows all possible options.
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
infratec
Always Here
Always Here
Posts: 7657
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: How to change Preference file value?

Post by infratec »

You should do some testing :wink:

If you open the preferences once,
you can always use one or more WritePreference.. commands.
If you call ClosePreference() at the end of your code the file is written completly. If you want or not.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: How to change Preference file value?

Post by Mythros »

Thanks alot, guys! <3 :)
Post Reply