Page 1 of 1
Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Posted: Sun Jun 13, 2021 11:34 am
by Mijikai
Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Re: Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Posted: Wed Jul 28, 2021 6:28 pm
by nsstudios
+1
being able to load inis from memory was something I've actually needed before, and saving a temporary file and quickly deleting is not very convenient.
Re: Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Posted: Thu Jan 04, 2024 5:30 pm
by Quin
+1, needed this in my project today.
Re: Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Posted: Thu Jan 04, 2024 9:21 pm
by mk-soft
-1
Makes no sense, because you cannot write prefs into the executable.
You can also read the data cleanly from a DataSection.
Re: Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Posted: Thu Jan 04, 2024 9:41 pm
by User_Russian
mk-soft wrote: Thu Jan 04, 2024 9:21 pm
Makes no sense
It makes sense. PB can only read/save in UTF-8.
You can load an ini file in a different encoding (ascii, utf-16) into memory using functions from the "File" library and use CatchPreferences().
Re: Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Posted: Thu Jan 04, 2024 10:16 pm
by nsstudios
I don't get what y'all are talking about.
If I want to include an ini file into my executable with includeBinary, just like I would include a json file, or an xml file, and I could CatchJson/CatchXml, or even, heck, ParseJson/ParseXml, why shouldn't I be able to CatchPreferences and ParsePreferences?

Or not even only for reading from executable, but what about reading/parsing it from a memory buffer downloaded with network lib, or http lib, or a string made up on the fly, or many other cases where needing to write to a (temporary) file is not ideal at all.
Re: Add CatchPreferences(*Preference,PreferenceSize.i[, Flags])
Posted: Thu Jan 04, 2024 11:16 pm
by jacdelad
All functions that write into/read from files should be doable in memore too. Including, imho, SVGVectorOut() (why do I necessarily have to write it into a file?).