[Gambas-user] Problem with Settings
Peter Peyotle
peterpeyotle at gmx.de
Sun Aug 4 10:55:06 CEST 2019
hello and good day,
I have a problem with the settings. At least in understanding.
I have a form with 2 classes. Class 1 and Class 2.
Each class has its own Settingsobject myClass.
Legend Settings objects refer to the same configuration file, for
example: mySettings = New Settings (Application.Path & "/" &
Application.Name & ".conf")
In class 2 the settings are written and saved: mySettings ["test /
teststring"] = setString
mySettings.save
in class 1 the settings are read out.
In the upper window of the example, the text is entered and read via the
button and output (see the example appendix).
If I enter "Hello" as the setting text, nothing is read at first.
I finish the application (or the class).
If I then enter another text, "Hello" will be read out. With another
input, the next to last text is always read out.
I know that these are two different objects. But they access the same
config file, in which the settings are saved, and yet they should read
the stored values correctly and not offset them.
Or is the text saved to the hard disk when the application exits? But
with mySettings.save this should already have happened?
What did not I understand there?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190804/5ed35b35/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setTest-0.0.1.tar.gz
Type: application/gzip
Size: 12186 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190804/5ed35b35/attachment-0001.gz>
More information about the User
mailing list