
Passing Arrays to a Function in ASP (VBScript)
How do I call a function in ASP (VBScript) passing two 2-dimensional
arrays as parameters and then pass an array back to the function call?
It seems to have a problem (within the function) recognizing that the
parameters passed are 2-dim arrays. Here is a summary of what I am
trying to do:
Dim OldData
Dim NewData
Dim rsOld
Dim rsNew
Dim AllData
*** Run queries to get recordsets ***
OldData = rsOld.GetRows()
NewData = rsNew.GetRows()
AllData = AppendData(OldData, NewData)
*
*
*
Function AppendData (OldArray, NewArray)
Dim TempArray
Dim sizeOldArray
Dim sizeNewArray
sizeOldArray = UBound(OldArray, 2) <--*** ERROR OCCURS HERE ***
sizeNewArray = UBound(NewArray, 2)
*** Perform loops to copy OldArray and NewArray into TempArray ***
AppendData = TempArray
End Function
This is the error message I get:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'UBound'
ANY IDEAS WOULD BE HELPFUL....THANKS!