what wrong in this example
Example...........
Printable View
what wrong in this example
Example...........
What's it supposed to do? What does it do now? Do you get any errors (which)? etc...
if we load txt file in form1 in list1 if we choose the number +ve number then get error
What error, and whats "+ve number"? What line gives you the error?
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.
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
vb Code:
If (List1.ListIndex + 1) > UBound(a) Then MsgBox "no array index for that" Else b = Split(a(List1.ListIndex + 1), "*") Text1.Text = b(List2.ListIndex + 1) Text2.Text = b(List2.ListIndex + 2) Text3.Text = b(List2.ListIndex + 3) Text4.Text = b(List2.ListIndex + 4) Text5.Text = b(List2.ListIndex + 5) Text6.Text = b(List2.ListIndex + 6) Text7.Text = b(List2.ListIndex + 7) Text8.Text = b(List2.ListIndex + 8) Text9.Text = b(List2.ListIndex + 9) Text10.Text = b(List2.ListIndex + 10) End If
thanks for you
the problem is resolved