Results 1 to 26 of 26

Thread: Reading contents of a text file [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Reading contents of a text file [RESOLVED]

    Hi,

    How would you open a text file and read a certain line of it?

    Eg. 1) Read the contents of Line 4 and if it is equal to something, then execute some code.
    2) If its equal to something else, exeucte some other code.
    3) If its not equal to either, produce an error message box saying invalid.

    Any ideas? Thanks

    Current I have:
    VB Code:
    1. Dim fileSettings As Short
    2.         fileSettings = FreeFile()
    3.         FileOpen(fileSettings, VB6.GetPath & "\SMSettings.ini", OpenMode.Input)
    It works fine and I have put Error Handlers to it so the program wont crash it if doesnt exist.
    Last edited by LITHIA; Nov 28th, 2003 at 10:41 AM.

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