Announcement

Collapse
No announcement yet.

Error 461 ???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error 461 ???

    1) I've got four arrays declared as GLOBAL.

    2) I've got an initialization function which accepts an array BYREF
    and REDIMs the array.

    3) I've got a CALLBACK function which calls the initialization function
    once for each GLOBAL array.

    4) I've got four separate CALLBACK functions which modify their respective
    GLOBAL array (without REDIMming - that's handled in the initialization
    function).

    I'm getting an error 461 at compile time in item #4. What do I need to do
    to fix this?



    ------------------
    Bernard Ertl
    Bernard Ertl
    InterPlan Systems

  • #2
    461 Array not dimensioned - The array being referenced has not been dimensioned yet
    Your error means a reference to an array physically precedes in the source code a DIM or REDIM statement for the variable.

    Fix: put your GLOBAL arrayname() AS whatever physically in the source prior to the function.


    MCM
    (receiver of many of these errors)
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Hi Michael,

      I've got all my GLOBAL declares in the main .BAS file at the top
      of the file.

      The functions which use the offending array(s) are in a .INC file.

      I guess I will have to explicitly dimension each array to one element
      in the main .BAS file. Seems messy.


      ------------------
      Bernard Ertl
      Bernard Ertl
      InterPlan Systems

      Comment


      • #4
        Bern, the GLOBAL statement is _before_ the #INCLUDE statement, right? If not, then the 461 is because the GLOBAL is not actually _before_ the first use of the array.

        If this does not help, can you please post the code? We should be able to spot the problem fairly quickly.

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Hi Lance,

          Yes, all my GLOBAL declarations precede the INCLUDE statements.

          I added a line to DIMension the arrays to one element and everything
          works again. I suspect the problem was that the initialization
          function was dimensioning the arrays through a BYREF parameter, so
          the compiler never saw an explicit DIMension for them.



          ------------------
          Bernard Ertl
          Bernard Ertl
          InterPlan Systems

          Comment

          Working...
          X