Results 1 to 9 of 9

Thread: [RESOLVED] what wrong in this example

  1. #1

    Thread Starter
    Lively Member SNIPER.PS's Avatar
    Join Date
    Dec 2009
    Posts
    96

    Resolved [RESOLVED] what wrong in this example

    what wrong in this example


    Example...........

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: what wrong in this example

    What's it supposed to do? What does it do now? Do you get any errors (which)? etc...

  3. #3

    Thread Starter
    Lively Member SNIPER.PS's Avatar
    Join Date
    Dec 2009
    Posts
    96

    Re: what wrong in this example

    if we load txt file in form1 in list1 if we choose the number +ve number then get error

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: what wrong in this example

    What error, and whats "+ve number"? What line gives you the error?

  5. #5

    Thread Starter
    Lively Member SNIPER.PS's Avatar
    Join Date
    Dec 2009
    Posts
    96

    Smile Re: what wrong in this example

    look at this




  6. #6
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: what wrong in this example

    That error means that the array called a does not have that many (List1.ListIndex + 1) elements. Depends on how the array is declared and populated.

  7. #7
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: what wrong in this example

    Sniper

    Picking up on Baja's post, at that "crash" line,
    • what is the value of (List1.ListIndex + 1)?
    • what is the size of a()?

    Spoo

  8. #8
    Fanatic Member FireXtol's Avatar
    Join Date
    Apr 2010
    Posts
    874

    Re: what wrong in this example

    vb Code:
    1. If (List1.ListIndex + 1) > UBound(a) Then
    2.    MsgBox "no array index for that"
    3. Else
    4.   b = Split(a(List1.ListIndex + 1), "*")
    5.   Text1.Text = b(List2.ListIndex + 1)
    6.   Text2.Text = b(List2.ListIndex + 2)
    7.   Text3.Text = b(List2.ListIndex + 3)
    8.   Text4.Text = b(List2.ListIndex + 4)
    9.   Text5.Text = b(List2.ListIndex + 5)
    10.   Text6.Text = b(List2.ListIndex + 6)
    11.   Text7.Text = b(List2.ListIndex + 7)
    12.   Text8.Text = b(List2.ListIndex + 8)
    13.   Text9.Text = b(List2.ListIndex + 9)
    14.   Text10.Text = b(List2.ListIndex + 10)
    15. End If

  9. #9

    Thread Starter
    Lively Member SNIPER.PS's Avatar
    Join Date
    Dec 2009
    Posts
    96

    Re: [RESOLVED] what wrong in this example

    thanks for you

    the problem is resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width