Click to See Complete Forum and Search --> : arrays


Steve Heckman
January 10th, 2000, 09:59 AM
I am trying to write a tetris like program for an
intro to programing class i am taking and i wanted to use an array to tell wether a box had been filled or not, to do this i would need to make the array public. It (vb5)won't let me do this. does anyone know how to make an array public or some other way to record whether a box has been filled? thanks for all the help.

HEIDI
January 10th, 2000, 10:19 AM
You can make an array public by declaring it in the General - declarations section of your project. If that doesn't work, try putting the word public in front of it instead of "dim"

Example:

General Declarations

Public array(3) as integer

Steve Heckman
January 10th, 2000, 10:37 AM
Neither of those things work with arrays, It gives me a...
"compile error:
constants, fixed-leingth arrays, and declare statements, not allowed as public members of object modules."
message box. thanks though

HEIDI
January 10th, 2000, 11:00 AM
You have to declare the public array in a module, not a form.

jaredy
January 10th, 2000, 09:15 PM
The previous posts are correct. You need to add a Module to your project and declare it there. You can't declare it in a form's General Declarations. It has to be in a module.

January 10th, 2000, 10:23 PM
How do i make a module?

valkyrie
January 10th, 2000, 10:36 PM
In your Project Explorer window, right-click at your project name, and select "Add Module"... simple as that... sorry that this post has nothing to do with the above, but it is right, you can't declare your array in the General Declaration section of your form.

____________________________________
The VB Bugs in my Life...