janetb
12-13-2004, 09:10 AM
I'm trying to grab the values from checkboxes that will always be in threes and put them into a 2-d array in order to loop for insert into sql. I've tried this from an earlier post, but I keep getting a vbscript "Subscript out of range: '[number: 2]' " - the line referenced is the arArray2(iLoop Mod 3,Int(iLoop/3..... (Modified from earlier posting response by Tom.)
contents of request("jid")=1,1,4, 1,1,8, 6,13,13, 5,9,9, 4,22,4
arArray1 = Split(request("jid"),",",-1,1) ' Split text into parts
iNum = UBound(arArray1) + 1 'Find the # of parts
If iNum Mod 3 = 0 Then
ReDim arArray2(1,iNum/3) ' Create 2D array
For iLoop = 0 To iNum - 1
' Place into correct indexes of the 2nd array
arArray2(iLoop Mod 3,Int(iLoop/3)) = arArray1(iLoop)
Next
End If
for x=0 to (iNum/3)-1
response.write "<br>data1=" & arArray2(0,x) & ", data2=" & arArray2(1,x) & ", data3=" & arArray3(2,x)
next
This is not my area of expertise, so any help is appreciated....
Thanks
contents of request("jid")=1,1,4, 1,1,8, 6,13,13, 5,9,9, 4,22,4
arArray1 = Split(request("jid"),",",-1,1) ' Split text into parts
iNum = UBound(arArray1) + 1 'Find the # of parts
If iNum Mod 3 = 0 Then
ReDim arArray2(1,iNum/3) ' Create 2D array
For iLoop = 0 To iNum - 1
' Place into correct indexes of the 2nd array
arArray2(iLoop Mod 3,Int(iLoop/3)) = arArray1(iLoop)
Next
End If
for x=0 to (iNum/3)-1
response.write "<br>data1=" & arArray2(0,x) & ", data2=" & arArray2(1,x) & ", data3=" & arArray3(2,x)
next
This is not my area of expertise, so any help is appreciated....
Thanks