[Gambas-user] Global arrays
Ron Onstenk
ronstk at ...239...
Sat Jul 8 14:36:52 CEST 2006
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?
>
The gambas IDE uses also global arrays
This is done in the module 'Project'.
By making a module 'Leonardo' with the array(s) and other
variables _and_ a SUB Main() as start they are available in
everey class via Leonardo.arrayname[x,y].
In the Main() you instantiate the current start Form.
The IDE code is a good sample with many usable methods as example.
( see in source tree at gambas2-1.9.xx/app/src/gambas2)
Ron
More information about the User
mailing list