[Gambas-user] A Beginner's Guide to Gambas

ron ronstk at ...239...
Wed Jul 4 01:49:15 CEST 2007


On Tuesday 03 July 2007 22:01, Rob wrote:
> In one of Ron Onstenk's replies to your posts, he actually suggested 
> commenting out the DIM line for this same reason.  But the replies 
> were going back and forth pretty fast, so it wouldn't surprise me if 
> you missed that one.
> 
> Rob
> 

LOL

I did mistaken reply to Benoit message instead his one.
BTW, I did not suggested but required it to be commented.

Only the way how I did. As far I know (locally dutch) we use many 
times the message like _'<----- Rem this line_ to say comment this line.

REM stands for the good old BASICs REM statement which is short 
for REMARK (or COMMENT) and also well known as the character ' 
or using in bash as character # :)

For Scott:
>  Your modifications worked. I noticed that you don't have the DIM hButton 
>  AS Button statement. Is that because of the PUBLIC statement in the main 
>  routine itself? (PUBLIC hButton AS Button?) I think I'm miss 

In fact the head of the class file where the PUBLIC statement is, is not 
'the main routine' but the 'global' part of the class (or module) file.
Also in this place, the global and what is written, it are declarations.

Variable declared in this global part are available in every FUNCTION 
and SUB in the class/module.

PRIVATE tells these are only inside this class/module available and
when PUBLIC you can use them in case of modules inside an other
class/module by prefix the name with the name of the orginal module
where the declaration is.

module: MyGlobal.module

  PUBLIC MyPubVar AS Integer ' anyone may use this
  PRIVATE MyPriVar AS Integer ' only code in me may use this

Form: MyForm.form

  SUB XYZ()
    PRINT MyGlobal.MyPubVar ' works
    PRINT MyGlobal.MyPriVar ' does not work
  END

Have fun with gambas and the guide as is :)

--
Ron





More information about the User mailing list