[Gambas-user] module or class?

Fabien Bodard gambas.fr at ...626...
Tue Nov 3 18:47:02 CET 2009


the difference is simple

a classe must be instanciate before to be called


dim hClass as new MyClass

hClass.Procedure



------

A module is static :

Module.Proc



But in gambas you can call class proc like with a module if this class is static

'Gambas class

CREATE STATIC

Public Sub MyProc

End


-----

the call:

MyClass.MyProc



So generally we use Module for generic Procedure, and Class for object


'Class CMen



Public Sub ShakeHand()
End

Public Sub Walk()
End



so :

Dim Fabien as new CMen

Fabien.ShakeHand
Fabien.Walk

Look about the object oriented progammation

POO


2009/11/3 Jean-Yves F. Barbier <12ukwn at ...626...>:
> Hi all,
>
> I don't understand very well the difference(s) between these two
> kinds; doc says if I put a procedure in a module I can call it
> directly, but in fact I can't: I must call it with its prefix,
> such as in a class: module.procedure
>
> So what's really the difference?
>
> JY
> --
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> 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