[Gambas-user] Global arrays

Benoit Minisini gambas at ...1...
Sat Jul 8 23:22:35 CEST 2006


On Saturday 08 July 2006 23:09, Leonardo Miliani wrote:
> Benoit Minisini ha scritto:
> > On Saturday 08 July 2006 11:40, Leonardo Miliani wrote:
> >> I have a problem I cannot solve.
> >> I would like to know how I can implement a global multi-dimensional
> >> array (valid for all the project and not just for a procedure or
> >> function). Gambas cannot let me declare a multidimensional array at the
> >> beginning of a class (it tells that arrays are not allowed there) and
> >> permits me only to declare a dinamic array (i.e.: byte[]).
> >> But in a program that I'm writing I _need_ a global multidimensional
> >> array (name[4,256])... How I can do that?
> >
> > In the development version, you can do:
> >
> > PUBLIC MyArray AS Byte[4, 256]
> >
> > Regards,
>
> This does work, thank you Benoit :-)
> Just one more thing to ask you. Do you think to leave this way of
> declaration inaltered or maybe I would like to se another way to get this?

I'm happy with this syntax. Do you want a new one? :-)

Note that it is just syntactic sugar for:

PUBLIC MyArray AS Byte[] = NEW Byte[](4, 256)

Regards,

-- 
Benoit Minisini




More information about the User mailing list