CodePudding user response:
It isn't difficult at all,"Every 5 seconds to read 1 row", it is ok to use the Timer control,
Specific to read the file, there are many kinds of schemes to implement,
Your "eight fields in a row," that you have to clear the data format!
If not, who knows what kind of, you need to do to "is divided into eight!"
To put the data into a TextBox, use the control array and can be done For loop;
Even the independent control, control pattern, but also 8, hard to write article 8 assignment statements directly also just as well...
CodePudding user response:
Have not learned VB mainly, but the graduation design to use, eight all stringsCodePudding user response:
Why every 5 seconds as opposed to every 0.05 secondsCodePudding user response:
Option Explicit
Dim flag As Boolean
Private Sub Command1_Click ()
Dim strLine As String, strCol () As String
Dim As Long, I n the As Long
Timer1. Interval=5000
Timer1. Enabled=True
Label1="Reading... "
Open "c: \ test \ test1. TXT" For Input As # 1
Do Until EOF (1)
The Line Input # 1, strLine
StrCol=Split (strLine, ", ")
N=UBound (strCol)
For I=0 To 7
If I & lt;=n Then
Text1 (I)=strCol (I)
The Else
Text1 (I)=""
End the If
Text1 (I). Refresh
Next I
Do Until flag
DoEvents
Loop
Flag=False
Loop
Close # 1
Timer1. Enabled=False
Label1="Finished"
End Sub
Private Sub Timer1_Timer ()
Flag=True
End Sub
CodePudding user response: