VB Code:
Option Explicit
'Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim mbQuit As Boolean
Private Sub Command1_Click(Index As Integer)
Dim intLine As Integer
Select Case Index
Case 0
ReadFile
Case 1
intLine = InputBox("Please enter the line to start from", "Start From", 1)
' There should be some validation of intLine here
ReadFile intLine
Case 2
mbQuit = True
DoEvents
Unload Me
End Select
End Sub
Public Sub ReadFile(Optional StartPoint As Integer = 1)
Dim ff As Integer
Dim lngCount As Long
Dim strLine As String
Dim dblClock As Double
ff = FreeFile
Open "C:\temp\test.txt" For Input As ff
Do Until EOF(ff)
lngCount = lngCount + 1
Line Input #ff, strLine
If lngCount >= StartPoint Then
Label1.Caption = strLine
DoEvents
dblClock = Timer
While Timer < dblClock + 10
DoEvents
If mbQuit Then
Unload Me
dblClock = 0
End If
Wend
End If
Loop
Close ff
End Sub