Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with Array 1

Status
Not open for further replies.

Zoom1177

Programmer
Oct 25, 2006
44
US
I am trying to do a test by just putting a table in an array and i am having some problems

all i need for now is just to print each row in the table

so i wrote the following in the body of the page

<%
dim lowcount
dim highcount
dim counter
dim myarray()

myarray = rsmenu.getrows()

lowcount = lbound(myarray,2)
highcount= ubound(myarray,2)

for counter= lowcount to highcount
response.write myarray(counter)& "<br/>"

next
%>

first i got "Type mismatch" error on the line that line:
myarray = rsmenu.getrows()

so i took out the: Dim myarray()
and it seemed to pass that error

the second error i got was at that line:
response.write myarray(counter)& "<br/>"

and the error was: Subscript out of range: 'myarray'

so i added above the response line the following line:
redim myarray(counter)

i got no errors but also no data displayed.

I am new to this so any help would be appreciate it.
thanks
 
myarray is a multidimensional array. When you are trying to access a value in the array it has a coordinate - you need to identify not only a column position but a row position. Please read my faq on multidimensional arrays with getRows() -- I think it's just what you need.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top