[Gambas-user] About help and arrays and variables

Demosthenes Koptsis demosthenesk at ...626...
Sat Nov 20 15:21:54 CET 2010


hi, i have gambas2-2.21 rev3300

> Now my examples tell me if i am right...
> 
> Dynamic arrays -------------------------
> 'locale scope in a SUB
> DIM aInt2 AS Integer[3]                'this is a dynamic array
> DIM aInt2 AS Integer[] = [1, 2, 3]     'another dynamic array
> 
> 'global scope in Declarations
> PUBLIC aInt2 AS Integer[] = [1, 2, 3]  'more dynamic arrays
> PRIVATE aInt2 AS Integer[] = [1, 2, 3]
> -------------------------------------------
> And now finally static arrays:
> 
> Static arrays -----------------------------
> 'local scope in a SUB
> DIM aInt2[10] AS Integer 'this static array is in a SUB!
> 
> 'global scope in Declarations
> PRIVATE aInt2[10] AS Integer ' this static array is ok in declarations
> PUBLIC aInt2[10] AS Integer  'this is forbidden in global scope, i get
> an error
> -------------------------------------------

for static arrays i could declare it as

aInt2[10] AS Integer

in FMain form without PRIVATE or STATIC word.

Is it accepted this?

-- 
Regards,
Demosthenes Koptsis.





More information about the User mailing list