making text appear from a line of a text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thumper5
    New Member
    • Jun 2007
    • 4

    making text appear from a line of a text file

    I am working on a program that needs to out put a certain line of text from a text file to the .text property of a textbox. any ideas? do you want more specifics on my project?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by thumper5
    I am working on a program that needs to out put a certain line of text from a text file to the .text property of a textbox. any ideas? do you want more specifics on my project?
    We will need specifics about exactly what you are trying to do. For instance, do you have code yet to read the file? If not, do you have any preference on how to do it? And when you say "a certian line" do you mean for example the fifth line? Or the line which contains a particular string, or what? And what version of VB are you using?

    If you have a look at the index at the top of the VB Articles area, there are a couple of samples there that show how to read a file.

    Comment

    • Tophurious
      New Member
      • May 2007
      • 13

      #3
      one way is to just to the following

      Code:
      Close #1
      Open "InputFile.Txt" For Input As #1
      
      Dim I as Integer
      For I = 0 to DesiredLine-1
       Line Input #1, X$
      Next I
      
      Line Input #1, X$
      
      Form1.TextBox1.Text = X$

      Comment

      Working...