[Gambas-user] Problem with gb.settings

Jussi Lahtinen jussi.lahtinen at ...626...
Wed Dec 10 19:01:07 CET 2008


I'm not sure what is the problem you mean....

PUBLIC SUB WriteSettings()

hCFG["General/Color"] = 666
hCFG.Save

END

PUBLIC SUB ReadSettings()
DIM aa AS Integer

PRINT hCFG["General/Color"] 'Print content to IDE console.

  aa = hCFG["General/Color"] 'Put content to aa (in this case integer).
  PRINT aa 'Print aa to IDE console, just to see that aa got it right.

END

Everything seems to work..?
Following example creates file content:

[General]
Color=666

Hope that helps...


Jussi


On Wed, Dec 10, 2008 at 7:20 PM, Georg Lassnig <glassnig at ...1994...> wrote:
> Am Mittwoch 10. Dezember 2008 18:05:45 schrieb gambas at ...1938...:
>> Hi List,
>>
>> This in the module area works.
>> Private hCFG As New Settings("/Path/To/cfg")
> Try this:
> Private hCFG As New Settings("/Path/To/cfg") AS "hCFG"
>
>
>>
>> Because I'm writing a component, now I have to do this in the module area:
>> Private hCFG As Settings
>>
>> And something like this in the _init-Sub
>> hCFG = New Settings("/Path/To/cfg")
>> 'Just for testing
>> Print hCFG["General/Color"]
> hCFG["General/Color"] = Variable
> hCFG.Save
>
>
>> ...and another question: Where can I get (read) informations about such
>> things and how to do them in Gambas?
> Do you mean this?
> Variable = hCFG["General/Color"]
>
> Regards
> George
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list