[Gambas-user] static functions in libraries?

Benoit Minisini gambas at ...2...
Sun Nov 9 18:28:27 CET 2003


Le Vendredi 7 Novembre 2003 20:45, Rob a écrit :
> OK, so I actually tried to use my shiny new library in a project,
> and after bashing my head against the wall because the IDE
> didn't recognize the "Loan" class despite the presence of USE
> "Finance" (with Finance in the same directory), I finally put
> "Public Loan as Loan" at the top of the module and "Loan = NEW
> Loan" in my sub after the USE, and then it complained because
> the functions I wrote are static.  But taking out the Loan = NEW
> Loan caused the functions to die with "Null object" (which makes
> sense.)
>
> So is it not possible to put static subs and functions into a
> library?  Can I not just tell my users to USE "Finance" at the
> start of their sub main and then use my static functions at
> will?  I'm trying to use the libraries to add functions they
> think are lacking in Gambas, not create a "Loan object" or
> whatever.
>
> Rob
>

Use a module, or a class with only static public functions. See the Config 
class used by the IDE, that is located in the Util project.

-- 
Benoit Minisini
mailto:gambas at ...1...





More information about the User mailing list