Results 1 to 5 of 5

Thread: multiple lines from a txt file

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    multiple lines from a txt file

    hey ive got a bat file i want to loadin txt format, i can load single lines from it, well the bottom one. can any one help me load it all

    heres my code
    Private Sub cmdLoad_Click()
    'Call AboutText
    Dim temp As String, Message As Long
    'this loads the about txtfile
    ChDir App.Path
    Open "c:\dude.bat" For Input As #1
    'While Not EOF(1)
    'Line Input #1, temp
    Text1.Text = Message '& vbCrLf & temp
    'Wend
    Close #1
    AboutText = Message
    End Sub
    cheers for the help

  2. #2
    Lively Member
    Join Date
    Jan 2002
    Posts
    108
    VB Code:
    1. Private Sub cmdLoad_Click()
    2. Dim temp As String
    3.  
    4.    Open "c:\dude.bat" For Input As #1
    5.     Do Until EOF(1)
    6.         Line Input #1, temp
    7.         Text1.Text = Text1.Text & temp & VBCrLf
    8.     Loop
    9.   Close #1
    10.  
    11. End Sub

    Hopes this helps you

    Good luck

  3. #3
    Megatron
    Guest
    VB Code:
    1. Open "MyFile" For Input As #1
    2. Text1 = Input(LOF(1),1)
    3. Close #1

  4. #4

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    cheers, youve saved me from hitting my computer in a fit of anger cheers

    thanks

  5. #5
    Lively Member
    Join Date
    Jan 2002
    Posts
    108
    Of course Megatron, that's the simplest solution. but it's harder for the newbies to understand what is going on with out proper comments course you know all about that

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