doanket
asked on
For..Next?
I have 2 array
- Array1: "1,2"
- Array2: "3,4,5"
1
3
4
5
2
3
4
5
I want use 2 for ..next
I Write code: For i= 1 To Array1
For j = i + 1 To Array2- j
Msgbox i & "_" & j
Next
Next
But not Yet
Help Me to Repair Code
Thank You.
- Array1: "1,2"
- Array2: "3,4,5"
1
3
4
5
2
3
4
5
I want use 2 for ..next
I Write code: For i= 1 To Array1
For j = i + 1 To Array2- j
Msgbox i & "_" & j
Next
Next
But not Yet
Help Me to Repair Code
Thank You.
ASKER
Thank Bluebeta but. I wite code in VB 6.0
This Tree is Values of 1Grid and I must read.
This Tree is Values of 1Grid and I must read.
Try this. Let just say that you have a 3-dimensional array call "myArray" where the first dimension contains
five (5) elements and the second dimension contains ten (10) elements, and the third dimension
contains twenty (20) elements. But In your case you'll have to comment out the third nested loop - "For kk ..."
For ii = 1 To 5 '// Dimension1, 5 elements
For jj = 1 To 10 '// Dimension2, 10 elements
For kk = 1 To 20 '// Dimension3, 20 elements
If myArray(ii, jj, kk) > 0 Then
Debug.Print myArray(ii, jj, kk)
End If
Next kk
Next jj
Next ii
five (5) elements and the second dimension contains ten (10) elements, and the third dimension
contains twenty (20) elements. But In your case you'll have to comment out the third nested loop - "For kk ..."
For ii = 1 To 5 '// Dimension1, 5 elements
For jj = 1 To 10 '// Dimension2, 10 elements
For kk = 1 To 20 '// Dimension3, 20 elements
If myArray(ii, jj, kk) > 0 Then
Debug.Print myArray(ii, jj, kk)
End If
Next kk
Next jj
Next ii
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<%
array1 = array(1, 2)
array2 = array(3, 4, 5)
for i=0 to ubound(array1)
response.Write array1(i) & "<br/>"
for j=0 to ubound(array2)
response.Write " " & array2(j) & "<br/>"
next
next
%>
hope this help.