2
Answers

changing the value of index1

ram son

ram son

17y
3k
1

What I am trying to do is, by using a command button or a timer, display the data sequentially, one line at a time in labels.But I also want to be able to control the start and end points in the data sequence -- for example I might want the data between 1-200, then btween 400-620 and so on.

This snippet

  1. If index1 < 1323 Then
  2. index1 = index1 + 1
  3. Else
  4. 'MsgBox "This is the last record of the data"
  5. Label1.Caption = line_value1(index1)     
  6. End If

works fine as long as I don't change the value of index1.
But as soon as I set index1=50 then it doesn't work right.

The label will display the line_value at line #50, but doesn't move to the next line as in the original where it keeps going till the end of the data in the file.

I am wondering if index1 is set as 1 by default in vb.net and cannot be changed this way because this  worked fine in vb6 also. Any ideas why it doesn't work in vbnet.
 
Any help is realy appreciated
Answers (2)