bp_maher
May 10th, 2002, 04:53 AM
Anyone know how I can pass a 2D array from my javascript fxn. to a VB dll. This is what I have at the moment and it doesn't work ...
//////////////// Javascript //////////////////////////////
function btnSave_onclick(){
var myArray = new Array ()
for (i=1; i < 10 ; i++){
myArray[i,0] = 'some value';
myArray[i,1] = 'some other value';
}
PageObject.execute.VB_DLL_Fxn(myArray);
}
///////////////////VB DLL //////////////////////////////////
Public function VB_DLL_Fxn ( aArray as Variant)
Dim i As Integer
Dim strMsg As String
If IsArray(aArray) Then
For i = 1 To UBound(aArray , 1)
MsgBox aArray (i, 0) & "-" & aArray (i, 1)
Next
Else
MsgBox "Not an array"
End If
Exit Function
EH:
Err.Raise Err.Number, , Err.Description
End Function
//////////////// Javascript //////////////////////////////
function btnSave_onclick(){
var myArray = new Array ()
for (i=1; i < 10 ; i++){
myArray[i,0] = 'some value';
myArray[i,1] = 'some other value';
}
PageObject.execute.VB_DLL_Fxn(myArray);
}
///////////////////VB DLL //////////////////////////////////
Public function VB_DLL_Fxn ( aArray as Variant)
Dim i As Integer
Dim strMsg As String
If IsArray(aArray) Then
For i = 1 To UBound(aArray , 1)
MsgBox aArray (i, 0) & "-" & aArray (i, 1)
Next
Else
MsgBox "Not an array"
End If
Exit Function
EH:
Err.Raise Err.Number, , Err.Description
End Function