[Gambas-user] Problem with Settings

Jussi Lahtinen jussi.lahtinen at gmail.com
Sun Aug 4 17:14:43 CEST 2019

By very quick look, I think "New Settings" will create new empty settings
file. Instead use it as static class.


On Sun, Aug 4, 2019 at 11:56 AM Peter Peyotle <peterpeyotle at gmx.de> wrote:

> 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?
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190804/536b192f/attachment.html>

More information about the User mailing list