[Gambas-user] Problem with Settings

Charlie Ogier charlie at cogier.com
Sun Aug 4 17:58:07 CEST 2019


Hi Peter,

Have a look at the attached program.

Charlie

On 04/08/2019 09:55, Peter Peyotle 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/7d3150e9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setTest.tar.gz
Type: application/gzip
Size: 13542 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190804/7d3150e9/attachment-0001.gz>


More information about the User mailing list