Results 1 to 4 of 4

Thread: Im having a little problem with opening and inputting files. (Resolved, thanks guys)

  1. #1

    Thread Starter
    Addicted Member SandmanSamR's Avatar
    Join Date
    Dec 2003
    Location
    Florida
    Posts
    131

    Im having a little problem with opening and inputting files. (Resolved, thanks guys)

    What I wanted to do is open a file (using Open "X" for input as #1) and have it show the contents of that file in a multiline textbox. What would I have to use to do this?
    Last edited by SandmanSamR; Aug 29th, 2004 at 08:22 AM.
    ';..;'
    Monsterous

    SANDMANSAMR
    SANDMANSAMR
    SANDMANSAMR
    SANDMANSAMR
    SANDMANSAMR

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    append VbLF to the end of the string, and load it into a textbox
    could also try VbCrLf or VbCr. forgot which is best, but i think the first will work.


  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    VB Code:
    1. Open "C:\jono.txt" For Input As #1
    2. Dim strInput As String
    3. Text1.Text = ""
    4. While Not EOF(1)
    5.     Line Input #1, strInput
    6.     Text1.Text = Text1.Text & strInput & vbCrLf
    7. Wend
    8. Text1.Text = Left(Text1.Text, Len(Text1.Text) - Len(vbCrLf))

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Or Smaller:
    VB Code:
    1. Open "X" For Input As #1
    2. Text1.Text = Input(LOF(1), 1)
    3. Close #1
    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

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