Results 1 to 29 of 29

Thread: 1 line at a time ::RESOLVED::

Hybrid View

  1. #1
    Addicted Member glyptar's Avatar
    Join Date
    Sep 2002
    Location
    The Netherlands
    Posts
    138
    This is an option that will keep IROY happy too

    VB Code:
    1. 'Declarations:
    2.  
    3. Dim i As Integer
    4.  
    5. Private Sub Form_Load()
    6.     i = 1
    7. End Sub
    8.  
    9. Private Sub Command1_Click()
    10.     Dim Var As String
    11.     Open "yourfile" For Input As #1
    12.     For a = 1 To i
    13.         If Not EOF(1) Then Line Input #1, Var
    14.         If EOF(1) Then
    15.             Command1.Enabled = False
    16.         End If
    17.     Next a
    18.     Close #1
    19.     Text1.Text = Var
    20.     i = i + 1
    21. 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).
    Last edited by glyptar; Sep 28th, 2002 at 05:35 PM.
    Glyptar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width