module or class?

View: New views
3 Messages — Rating Filter:   Alert me  

module or class?

by Jean-Yves F. Barbier-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: module or class?

by Fabien Bodard-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...>:

> 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@...
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: module or class?

by Jean-Yves F. Barbier-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fabien Bodard a écrit :

> 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 YesMen
>
>
>
> Public Sub ShakeHand()
> End
>
> Public Sub Walk()
> End
>
>
>
> so :
>
> Dim Fabien as new YesMen
>
> Fabien.ShakeHand
> Fabien.Walk
>
> Look about the object oriented progammation
>
> POO

Ok, thanks Fabien, this clear

JY
--
Troubled day for virgins over 16 who are beautiful and wealthy and live
in eucalyptus trees.

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/gambas-user