VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command2 
      Caption         =   "LOF"
      Height          =   255
      Left            =   2640
      TabIndex        =   3
      Top             =   360
      Width           =   735
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   360
      TabIndex        =   2
      Text            =   "Text2"
      Top             =   960
      Width           =   2655
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   360
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   360
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Read Line"
      Height          =   495
      Left            =   1920
      TabIndex        =   0
      Top             =   2040
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim fileNum As Integer

Private Sub Command1_Click()
    Dim str As String
    fileNum = FreeFile
    Open Text2.Text For Input As #fileNum
    
        If Val(Text1.Text) <= LOF(1) Then
            Seek #fileNum, Val(Text1.Text)
        Else
            Seek #fileNum, LOF(1)
        End If
        Line Input #fileNum, str
        MsgBox str
        MsgBox Seek(fileNum)
        Text1.Text = Seek(fileNum)
    Close #fileNum
    
    
End Sub

Private Sub Command2_Click()
    fileNum = FreeFile
    Open Text2.Text For Input As #fileNum
    Text1.Text = LOF(fileNum)
    Close #fileNum
End Sub

Private Sub Form_Load()
    Text2.Text = "c:\temp\savings and joint.txt"
    Text1.Text = 1
End Sub
