Posted on 2004-11-08
Last Modified: 2010-04-17
I have 2 array
- Array1:   "1,2"
- Array2:   "3,4,5"
I want use 2 for
I Write code: For i= 1 To Array1
                         For j = i + 1 To Array2- j
                               Msgbox i & "_" & j
But not Yet
Help Me to Repair Code
Thank You.
Question by:doanket
    LVL 3

    Expert Comment

    Try this :

    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 "&nbsp;" & array2(j) & "<br/>"

    hope this help.

    Author Comment

    Thank Bluebeta but. I wite code in VB 6.0
    This Tree is Values of 1Grid and I must read.

    LVL 12

    Expert Comment

    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

    Accepted Solution

    I think this is the VB Code you are looking for.
    All The Bests.

    Dim i As Integer
    Dim j As Integer
    '---Define The Array's----
    Dim array1(1) As String
    Dim array2(2) As String

    '---Fill Data In The Array's, I Have Used 2 Methods To Do That---
    array1(0) = "1"
    array1(1) = "2"

    i = 0
    While i < 3
        array2(i) = i + 3
        i = i + 1

    '----Show The Contents Of The Array's----
    For i = 0 To UBound(array1)
        For j = 0 To UBound(array2)
            MsgBox (array1(i) & "_" & array2(j))
            MsgBox (i & "_" & j)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Title # Comments Views Activity
    fizzArray2 challenge 1 41
    has12 challenge 13 52
    Add mobile access to browser application 3 108
    mapBully challenge 6 51
    Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now