[Gambas-user] Strange behaviour using gb.settings in a component
gambas at ...1938...
gambas at ...1938...
Wed Dec 24 11:16:51 CET 2008
Hi List,
perhaps a silly question, but here it is:
In my component I do:
' Gambas module file
Export
Private hCFG As Settings
Public Sub _init()
hCFG = New Settings(User.Home &/ "projekte/gambas/xyz.cfg")
End
After that I have defined my public functions.
xyz.cfg holds some connection parameters which are only used by the component
itself.
When I execute my component directly, everything is fine!!!!!
When calling a function of this component from my application like this:
' Gambas module file
Private ABC As New Modxyz
Public Sub Main()
Print ABC.SomeFunction
End
and executiong the app in the IDE, I get:
Syntax error in settings file at line #6: Connot load class 'Main'. Unable to
load class file.
In the meanwhile I checked out the following:
When I comment out
hCFG = New Settings(User.Home &/ "projekte/gambas/xyz.cfg")
in the component. This error is gone...certainly I have no access to my
configfile anymore and so the component can't read its connection parameters.
Any idea, what I have to do, so that my config file could be read, when the
component is called from an app?
Thanks in advance and have a merry christmas!
Greetz
Stevie
More information about the User
mailing list