ASP > Arrays articles: • Dumping the contents of a 2-dimensional array
• Sorting a multi-dimensional array in ASP VBScript
Read
• Splitting delimited text into a multi-dimensional array
Read
|
Return to index of articles
Dumping the contents of a 2-dimensional array
Category: ASP
Category: Arrays
A simple function to dump the contents of a two-dimensional array to the browser. Good for debugging e.g. when you have a recordset and use GetRows to put it into an array and want to verify the contents of the array.
Public Sub dumparray(anarray) ' ----------------
' used for testing / debugging to dump array of results
dim rows, cols, x, y
rows = ubound(anarray, 2)
cols = ubound(anarray)
response.write ""
for x = 0 to rows
response.write ""
for y = 0 to cols
response.write "" & left(anarray(y,x), 20) & " | "
next
response.write " "
next
response.write " "
end sub
4/3/2008
|