[Gambas-user] Settings[] cannot be used statically?

Jussi Lahtinen jussi.lahtinen at gmail.com
Thu Jan 23 21:49:16 CET 2020


I currently use Settings statically without any errors.

Jussi

On Thu, Jan 23, 2020 at 9:03 PM T Lee Davidson <t.lee.davidson at gmail.com>
wrote:

> The documentation[0] seems to indicate that Settings can be used
> statically. However, when I try to do that according to the
> examples, I get a "Null object" error.
>
> I created an application settings (.conf) file by hand so the settings
> could be restored on Form_Open with:
> txtUserName.Text = Settings["User/Name"]
> txtUserEmail.Text = Settings["User/Email"]
>
> That didn't work, so I tried to let the app save its own settings file on
> Form_Close with:
> Settings["User/Name"] = txtUserName.Text
> Settings["User/Email"] = txtUserEmail.Text
>
> Both attempts gave the "Null object" error.
>
> Is the documentation in error, or is this a bug?
>
>
> --
> Lee
>
> Gambas v3.14.3
>
> [0] http://gambaswiki.org/wiki/comp/gb.settings/settings
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200123/bc97e31e/attachment.html>


More information about the User mailing list