[Gambas-user] Dim

Bodard Fabien gambasfr at ...11...
Mon Aug 16 21:23:02 CEST 2004


Le dimanche 15 Août 2004 20:32, Michael Sullivan a écrit :
> Whenever I use 'Dim' to declare an object, Gambas gives me a syntax
> error, but when I change 'Dim' to 'Public' or 'Private' it works fine.
> Why is this?  Am I doing something wrong?
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user


You can use Dim only in function or sub...

For the header variable whose are global, to the file, or more, You must use 
PUBLIC or PRIVATE keyword...


For information you can do

'class
Private iMyVar as integer  'it'savailable for all the class !

PUBLIC SUB _New()
DIM MyLocalVar as Integer 'only available in the function
MyLocalVar2 as Integer



END

Fabien Bodard




More information about the User mailing list