473,396 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

array error: variable is undefined

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.
Jul 21 '05 #1
7 1870
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" <bo*********@hotmail.com> wrote in message
news:10*************@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.

Jul 21 '05 #2
bob garbados wrote:
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.


It would help if you told us which line is referred to in your error
message. Based on what i see here, I have to think this error is occurring
elsewhere. Search your code for a reference to "arrProducts" instead of
"m_arrProducts"

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 21 '05 #3
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:%2****************@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" <bo*********@hotmail.com> wrote in message
news:10*************@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.


Jul 21 '05 #4
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" <bo*********@hotmail.com> wrote in message
news:10*************@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:%2****************@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" <bo*********@hotmail.com> wrote in message
news:10*************@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.
>
>



Jul 21 '05 #5
I guess I've been staring at this for too long...

The error referring to m_arrProducts was my fault and I created it trying to
fix the error referring to arrProducts, so you were right the first time
with both suggestions Ray. arrProducts was used in an include file and not
declared.

My parachute for having difficulty here is the code I'm working on was
poorly written and the application has no documentation so I'm still getting
a grasp on the pieces of the puzzle. It was someone's first forray into asp
and it goes to show that a solid design with a little bit of documentation
goes a long way.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP15.phx.gbl...
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" <bo*********@hotmail.com> wrote in message
news:10*************@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:%2****************@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" <bo*********@hotmail.com> wrote in message
news:10*************@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.
>
>



Jul 21 '05 #6

"bob garbados" <bo*********@hotmail.com> wrote in message
news:10*************@corp.supernews.com...
It was someone's first forray into asp
and it goes to show that a solid design with a little bit of documentation
goes a long way.


It's a shame that such a thing rarely exists! :]

Ray at home
Jul 21 '05 #7
Design???? Documentation???

Next thing you know, you'll be wanting a Functional Spec!

:>)

Bob Lehmann

"bob garbados" <bo*********@hotmail.com> wrote in message
news:10*************@corp.supernews.com...
I guess I've been staring at this for too long...

The error referring to m_arrProducts was my fault and I created it trying to fix the error referring to arrProducts, so you were right the first time
with both suggestions Ray. arrProducts was used in an include file and not declared.

My parachute for having difficulty here is the code I'm working on was
poorly written and the application has no documentation so I'm still getting a grasp on the pieces of the puzzle. It was someone's first forray into asp and it goes to show that a solid design with a little bit of documentation
goes a long way.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP15.phx.gbl...
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" <bo*********@hotmail.com> wrote in message
news:10*************@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:%2****************@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" <bo*********@hotmail.com> wrote in message
> news:10*************@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.
> >
> >
>
>



Jul 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: nobody | last post by:
hello everybody, is there a way of creating an array with help of a function that would accept the name of this array as a parameter and then create global Array type variable of that name? so...
21
by: scandal | last post by:
I am a javascript newbie working on a script that checks whether a "path" from one element in an array to another is "blocked." Currently, the script pushes an already processed cell index (hence...
1
by: john | last post by:
Relatively new to C coding, so any help would greatly be appreciated. I'm having problems try to return my string array from my parsing function. When I do a printf I am getting the correct value...
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
10
by: Ni | last post by:
I found out smth strange in g++ >= 3.3.5 => I was able to do register char buff;//// where outSTDBuffer is a variable!!!! Is it a bug in gcc or specification of c++ changed?? I've noticed this...
1
by: osamutoglu | last post by:
Platform is VS.NET 2003 and i am trying to design an application with Forms What is wrong here i didnt get it.. is there something i am missing? .. .. ../** STRUCTURE PROTOTYPE **/ struct...
21
by: vito | last post by:
how to achieve that? it seems php doesn't support it well for a C programmer? i hope to use something like: a; a; a;
45
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
37
by: miken32 | last post by:
In PHP, if a function returns an array it's fairly common to capture its return values like this: <?php list($foo, $bar, $baz) = some_function_that_return_an_array(); ?> In Javascript, would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.