[Gambas-user] Problems with Settings in Gambas 1.9.9

ML ml at ...973...
Tue Jun 7 15:20:25 CEST 2005


On 07/06/2005 12:51, Benoit Minisini wrote:
> On Monday 06 June 2005 15:37, PV wrote:
> 
>>Hi all!
>>
>>I upgraded to Gambas 1.9.9 and I noticed a strange behavior with the
>>Settings class.
>>I created a test project which includes the Settings class but if I code
>>something like
>>
>>DIM s AS Settings
>>s = NEW Settings("/path/to/file")
>>
>>at runtime Gambas issues an error "Type mismatch: wanted Integer, got
>>String instead".
>>
>>What is even stranger is that, if I uncheck the gb.settings component from
>>the project properties, the error disappears and everything works!
>>
>>Has anybody else experienced the same behavior?
>>
>>Regards,
>>Piero
>>
> 
> 
> Everything seems to work fine there. Can you send me your project ?


Well, actually the project is not a project :-), it is just a test composed of 
one form, one button and this sub:

PUBLIC SUB Button1_Click()

   DIM s AS Settings

   s = NEW Settings("/home/piero/prova.ini")

   message(s["Test/Chiave1"])

END

The prova.ini file looks simply like this:

[Test]
Chiave1=pippo

That's it! :-)

Upon launching the program and pushing button1, Gambas stops, highlights the 
line s = NEW Settings("/home/piero/prova.ini") and issues the error message as 
per above.

What might be useful to know is this other test I've made.
I've disabled the gb.settings component in this same project and added the 
Settings.class file directly to the project itself.
After making a couple of necessary changes to it (the Main.ToString/FromString 
thing), everything works fine, no problem at all.

Thanks,
Piero





More information about the User mailing list