Undeclared array error with version 5

Discussion in 'Questions (Windows Mobile)' started by mwaite, May 18, 2007.

  1. mwaite

    mwaite Member Licensed User

    OK maybe I'm jumping the gun a little, but I couldn't help but notice B4PPC v5 is posted! :sign0060: (admitedly I was checking emails and the web just in case)

    Thought I would recompile an application coded from v4 to see if I can get any speed improvement with v5

    When I try to run the program I get a compiling error: Use of undeclared array
    Here's the line: Dim NewArray(y) as Byte

    Isn't DIM doing just that, declaring the array?

    (the y variable is passed to the sub)
     
  2. Cableguy

    Cableguy Expert Licensed User

    Mwait
    In the "What's New" page is stated that one of the new features of v5 is the ability to turn on or off alerts about unused or empty variables....
     
    Last edited: May 18, 2007
  3. Erel

    Erel Administrator Staff Member Licensed User

    Arrays and structures must be first declared in Sub Globals.
    You can later declare them again with a different size if needed.
     
  4. mwaite

    mwaite Member Licensed User

    Thank you Erel.

    And thank you for v5. (Just playing with the trial version right now, waiting for my email :))

    I want you to know I searched the entire help file before posting because I didn't want to ask a stupid question - and hey, didn't see it, so it wasn't a stupid question, right?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    It was a very important question and I'm sure that the answer will help others too.
    Arrays in Basic4ppc are always global variables.
     
  6. Cableguy

    Cableguy Expert Licensed User

    In my book, There's no such thing as a "stupid Question", there are "already answered question"....

    In the OLD forum I once said that "one should be proud of what one know, but humble enough to learn with others", or something like that....Be carefull with the GUN though....:)
     
  7. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I said it last time and I'll say it again - very profound words my friend :sign0188:

    Regards,
    RandomCoder
     
Loading...