On Tue, 16 Sep 2014 00:03:22 +0200
Benoît Minisini <gam...@users.sourceforge.net> wrote:

> Le 15/09/2014 23:52, John Leake a écrit :
> >>
> >> Private by default. It's like a class, except everything is static.
> >>
> > So if I have a module containing some general purpose functions that I
> > wish to share across all the forms in a project,  can simply declare
> > these functions as Public within the module ?
> >
> 
> Yes.
> 
> -- 
> Benoît Minisini
> 

Also, if you need to share objects around the various parts of the project you 
can declare them in the module as either public variables or (if you want to 
add some shareable features) as properties of the module.

However, remember this: As you are accessing static features you need to 
explicitly use the module name qualifier when you reference them in other code.

So for example:

in module "MyUtil"

Public CurrentCustomer As CCustomer

Public Sub Execute_Current_Customer(PrejudiceLevel As Integer)
  CurrentCustomer = Null
End

in, say, "FMain"

Public Sub Load(CustID)

  MyUtil.CurrentCustomer.Load(CustID)
  If MyUtil.CurrentCustomer.IsLatePayer then
    MyUtil.Execute_Current_Customer(iExtreme)
  EndIf

etc


hth
Bruce


-- 
B Bruen <adamn...@gmail.com>
Note: temporary change to email address

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to