[Gambas-user] Array constant

Fabien Bodard abidoo.too at ...11...
Tue May 25 22:03:33 CEST 2004


Le mardi 25 Mai 2004 21:00, Grahame White a écrit :
> Is there anyway to a make a constant array?
>
> For example something like:
>
> 	PUBLIC CONST POW2[10] AS Short[] = (1, 2, 4, 8, 16, 32, 64, 128, 256, 512)
>
>
>
>
> Grahame
>
Constants declaration 
( PUBLIC | PRIVATE ) CONST Identifier AS Datatype = Constant value 

This declares a class global constant. 
- This constant is accessible everywhere in the class it is declared. 
- If the PUBLIC keyword is specified, it is also accessible to the other 
classes having a reference to an object of this class. 
- Constant must be booleans, integers, floating point numbers or strings. 




no  ;-)

Actually you have just the way public variable to define array....

<to benoit> hey, why not a possibility, to define const as class type
like :
PUBLIC CONST POW2 AS Short[] = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]

or something in this mind.

I've another question.... what about the TYPE keyword ?

</>


> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> _______________________________________________
> 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