This is an option that will keep IROY happy too
VB Code:
'Declarations: Dim i As Integer Private Sub Form_Load() i = 1 End Sub Private Sub Command1_Click() Dim Var As String Open "yourfile" For Input As #1 For a = 1 To i If Not EOF(1) Then Line Input #1, Var If EOF(1) Then Command1.Enabled = False End If Next a Close #1 Text1.Text = Var i = i + 1 End Sub
opens and closes the file in the same sub and works fine, reading one line at a time (which is what she asked for).




Reply With Quote