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

Gianluigi bagonergi at gmail.com
Thu Jan 23 22:56:10 CET 2020


Il giorno gio 23 gen 2020 alle ore 21:50 Jussi Lahtinen <
jussi.lahtinen at gmail.com> ha scritto:

> 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.
>>
>
Have you tried this ? :

Public Sub Form_Open()

  txtUserName.Text = Settings["User/Name", Null]
  txtUserMail.Text = Settings["User/Email", Null]

End

Public Sub Form_Close()

  Settings["User/Name"] = txtUserName.Text
  Settings["User/Email"] = txtUserMail.Text

End

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200123/91fbf785/attachment.html>


More information about the User mailing list