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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with arrays

Status
Not open for further replies.

gojohnnygogogogo

Programmer
May 22, 2002
161
GB
hello all,
how can I write this array with this first row being blank ?

(rs = select * from table)

tempArray = oRS.GetRows()
end if

'Create a temp. array of the select statement in VBscript.
Response.Write(&quot;<scri&quot; & &quot;pt language=VBScript>&quot; & vbcrlf)

Response.Write(&quot;ReDim tempArray(&quot; & Ubound(tempArray, 1) &&quot;, &quot; & UBound(tempArray, 2) & &quot;)&quot; & vbcrlf)
For iRows = 0 to UBound(tempArray, 2)
For iCols = 0 to UBound(tempArray, 1)
Response.Write(&quot;tempArray(&quot; & iCols & &quot;, &quot; & iRows & &quot;) = &quot; & Chr(34) & Replace(tempArray(iCols, iRows), Chr(34), Chr(34) & &quot; & Chr(34) & &quot; & Chr(34)) & Chr(34) & vbcrlf)
Next
Next


Response.Write(&quot;</scri&quot; & &quot;pt>&quot; & vbcrlf)


so my array looks like :

tempArray(0, 0) = &quot;&quot;
tempArray(1, 0) = &quot;&quot;
tempArray(2, 0) = &quot;&quot;
tempArray(3, 0) = &quot;&quot;
tempArray(4, 0) = &quot;&quot;
tempArray(5, 0) = &quot;&quot;
tempArray(0, 1) = &quot;row1col1&quot;
tempArray(1, 1) = &quot;row1col2&quot;
tempArray(2, 1) = &quot;row1col3&quot;
tempArray(3, 1) = &quot;row1col4&quot;
tempArray(4, 1) = &quot;row1col5&quot;
tempArray(5, 1) = &quot;row1col6&quot;
tempArray(0, 2) = &quot;row2col1&quot;
tempArray(1, 2) = &quot;row2col2&quot;
tempArray(2, 2) = &quot;row2col3&quot;
tempArray(3, 2) = &quot;row2col4&quot;
tempArray(4, 2) = &quot;row2col5&quot;
tempArray(5, 2) = &quot;row2col6&quot;
and so on...

is this possible ?
thank you.
 
Not that I am aware of. I can't see why you would want to do this either.

If you need some blanks before printing you can something add this before your other loop:
Code:
For iCols = 0 to UBound(tempArray, 1) 
   Response.Write &quot;Pre-Record Field #&quot; & iCols & &quot; = &quot;&quot;&quot;&quot;&quot;&quot;
Next


Maybe if you tell us why your needing to do this we could give you some pointers towards another method that would be effective.

-Tarwn ________________________________________________________________________________
Sometimes it is how you ask the question: faq333-2924
Many ASP questions have already been answered, please check faq333-3048 and use the search tool before posting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top