Results 1 to 4 of 4

Thread: [Resolved]Simple Read .txt

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    301

    Resolved [Resolved]Simple Read .txt

    I have a text1 and this code:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     text1.text = "My text"
    5.         On Error GoTo errorHandeler
    6.             Open "c:\temp.txt" For Output As #1
    7.                 Print #1, text1.Text
    8.             Close #1
    9. errorHandeler:
    10. End Sub
    11.  
    12. Private Sub Form_Load()
    13. On Error GoTo errorHandeler
    14.     Dim Text As String
    15.         Open "c:\temp.txt" For Input As #1
    16.                
    17.                 Exit Sub
    18. errorHandeler:
    19. End Sub
    But, the READ txt function is not good, how to make it puts the text from the ini into my Text1?

    [that is a part of a code that Gavio me, I use it for something diffrent now but dont know how to edit it]
    Last edited by Account; Aug 18th, 2006 at 12:17 PM.

  2. #2

  3. #3
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Simple Read .txt

    VB Code:
    1. Private Sub Form_Load()
    2. On Error GoTo errorHandeler
    3.     Dim Text As String
    4.         Open "c:\temp.txt" For Input As #1
    5. [B]            Do While Not EOF(1)
    6.                 Line Input #1, Text
    7.                      Debug.Print Text
    8.             Loop[/B]
    9.         Close #1
    10. errorHandeler:
    11. End Sub

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    301

    Re: Simple Read .txt

    ok, both helped:]

    Thnx, topic Resolved

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