CatchPreferences(*MemoryAddress)
Posted: Fri Mar 04, 2016 3:50 pm
Allow Preferences to be embedded, for example a language file which can be easily edited away from the source code. This would allow for reading in of multi-line strings without having to use escape characters in source code or xml and to allow for a single file release.
See http://www.purebasic.fr/english/viewtop ... =3&t=65077 for the trigger that made me think about this request.
Languages.txt
See http://www.purebasic.fr/english/viewtop ... =3&t=65077 for the trigger that made me think about this request.
Code: Select all
Result = CatchPreferences(?Languages)
If Result
PreferenceGroup("English")
BigString$ = ReadPreferenceString("BigString")
SmallString$ = ReadPreferenceString("SmallString")
EndIf
End
DataSection
Languages:
IncludeBinary "Languages.txt"
EndDataSection
Code: Select all
[English]
BigString=Hello World
This is a multi line test
SmallString=Hello World
[Welsh]
BigString=OI Butt
Phlem Phlem spit spit
SmallString=OI Butt with unicode characters ‰