Results 1 to 3 of 3

Thread: Wait a second... how do you....

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    99
    how would you read each line of a file into a seperate element of a listbox?


    how could you delete the first 10 characters from a string?
    ___________________________
    Chris

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    1. Try using Line Input

    2. str = Right(str, Len(str) - 10)
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Guest
    Q1: (Example)

    Code:
    Public Sub List_Load(TheList As ListBox, FileName As String)
    On Error Resume Next
    Dim TheContents As String
    Dim fFile As Integer
    fFile = FreeFile
     Open FileName For Input As fFile
       Do
         Line Input #fFile, TheContents$
            TheList.AddItem TheContents$
       Loop Until EOF(fFile)
     Close fFile
    End Sub
    
    Usage
    
    Call List_Load(List1, "C:\myfile.txt")

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