CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: arrays

  1. #1
    Join Date
    Jan 2000
    Posts
    3

    arrays

    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.


  2. #2
    Join Date
    Jan 2000
    Location
    NC, USA
    Posts
    56

    Re: arrays

    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




  3. #3
    Join Date
    Jan 2000
    Posts
    3

    Re: arrays

    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


  4. #4
    Join Date
    Jan 2000
    Location
    NC, USA
    Posts
    56

    Re: arrays

    You have to declare the public array in a module, not a form.


  5. #5
    Join Date
    Jan 2000
    Location
    Colorado
    Posts
    9

    Re: arrays

    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.


  6. #6
    Guest

    Re: arrays

    How do i make a module?


  7. #7
    Join Date
    Dec 1999
    Location
    Malaysia
    Posts
    56

    Re: arrays

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured