[Gambas-user] Global multidimensional arrays

ML ml at ...973...
Sat May 7 14:11:24 CEST 2005

Hi all,

a few days ago I came across Gambas and the more I discover about it the more I
like it!
Congratulations to all the developers for their very neat, promising work!!!

Having started coding some test applications, I have a problem though that I
haven't been able to solve by trial and error and also by looking at the
documentation and in the ML.
It could just be a matter of poor experience and practice with Gambas but I
have yet to find a solution.

The problem is that I need to have a global bidimensional array of floats,
available through all modules and classes.

According to the help file,

"There is no such thing as a project-wide global variable in Gambas. As a
workaround, consider making a class called Global and declaring your global
variables as static public variables in that class, and then referring to them
as Global.variablename in your project. It's still poor programming practice
but at least they'll be identified as global variables whenever you use them".

That's exactly what I've tried to do, but if I create a Global class and
declare in it a "static public P[5,5] as float", when trying to compile the
code, I get a "Arrays are forbidden here at line xx in Global class" error.

So, if arrays are forbidden here, how can I overcome this problem?

TIA for your help,

More information about the User mailing list