Re: array error: variable is undefined

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ray Costanzo [MVP] (my)
Date: 10/21/04


Date: Thu, 21 Oct 2004 17:26:09 -0400

Can you copy and paste the real code and the real error, which will also
include the number line as Bob suggested then? With the code that you
posted, I do not see any reason for you to get that error, as the variable
is declared with global scope.

Ray at work

"bob garbados" <bobgarbados@hotmail.com> wrote in message
news:10nga1qnf1f1c6a@corp.supernews.com...
>I freehanded the error message instead of copy/paste and goofed, the error
> does specify m_arrProducts. I inherited a bunch of ugly code and I
> totally
> spaced the include files. There is all kinds of odd stuff being done in
> the
> includes and the problem comes from one of them. Thanks for the
> direction.
>
>
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
> message news:%23IPVdE7tEHA.2452@TK2MSFTNGP10.phx.gbl...
>> Notice that the error says that arrProducts is undefined, not
> m_arrProducts.
>> Are you sure that you don't have "arrProducts" typed elsewhere in the
> code?
>> Perhaps in an include file if not in this actual file?
>>
>> Ray at work
>>
>> "bob garbados" <bobgarbados@hotmail.com> wrote in message
>> news:10ng8137cb5iqcb@corp.supernews.com...
>> > Can someone point out why this is giving me the error "Variable is
>> > undefined: 'arrProducts' "
>> >
>> > <begin_code>
>> >
>> > Dim m_arrProducts()
>> >
>> > Sub SerializeCart()
>> > ReDim m_arrProducts(m_intCartCount -1)
>> > response.Write("ARRAY: " & IsArray(m_arrProducts) & " Cart Count: " &
>> > m_intCartCount)
>> > For intCounter = 0 to m_intCartCount - 1
>> > response.Write("product 1" & "<br/>")
>> > Next
>> > End Sub
>> >
>> > <end_code>
>> >
>> > the Response.Write prints "True" for IsArray and "2" for
>> > m_intCartCount.
>> >
>> >
>>
>>
>
>



Relevant Pages

  • Re: attr_reader vs Objects and Attributes
    ... Robert Klemme wrote in post #980811: ... I believe he did not get an error message but an empty (nil) output ... report the real code and the real issue. ...
    (comp.lang.ruby)
  • Re: Error Trapping for trying to run an exe file without supporting files
    ... the easiest way to do this is to check for the file presense ... before running any real code. ... files are you just show the user an error message and exit the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Cant use TComponent in thread object?
    ... Please copy and paste your real code. ... you get people pointing out errors that you might have just introduced while trying to retype your code from memory. ... Debugger Exception Notification ... Both the addresses in the error message are non-zero, which is a very good sign. ...
    (alt.comp.lang.borland-delphi)
  • Re: JSP form beginner question
    ... generates an error message using a Map of error messages. ... It compiles fine ... Why not post the real code? ...
    (comp.lang.java.help)
  • Re: Boolean getter/setter methods and their names
    ... *Use* the design in real code: then you discover what's needed. ... able to specify and check binary states as values. ...
    (comp.programming)