Results 1 to 8 of 8

Thread: starting a new line: yes another text file question: ANother one resolved!

  1. #1

    Thread Starter
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609

    starting a new line: yes another text file question: ANother one resolved!

    this piece of code makes a line in a text file BUT - the user has to put in more than one line (probably about 20) so how would i get it to add a new line each time they press the same button?

    Any insight greatly appreciated
    xxxx
    Last edited by evexa; Jul 21st, 2003 at 04:55 PM.
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    What piece of code?


    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Thread Starter
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609
    Originally posted by manavo11
    What piece of code?
    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.  
    4. Open "e:/corporate/mla/vb/text2.txt" For Output As #1
    5.     Print #1, Text1(4).Text & ", " & Text1(0).Text & ". " & Text1(1).Text & " " & Text1(3).Text & ":" & Text1(2) & "."
    6. Close #1
    7.  
    8. End Sub

    ise ellinos?
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    I thought print printed to a new line each time.

    Yes I am Greek btw... I never expected you to speek Greek though!


    Has someone helped you? Then you can Rate their helpful post.

  5. #5

    Thread Starter
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609
    Originally posted by manavo11
    I thought print printed to a new line each time.

    Yes I am Greek btw... I never expected you to speek Greek though!
    *Sigh* nobody ever expects it :P most greeks living in the US say Parakalo smash a plate and call themselves greek *ptoo*.
    Although i must say my greek is getting worse and worse!

    And no - print just writes over it
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    Open "e:/corporate/mla/vb/text2.txt" For Append As #1
    Print #1, Text1(4).Text & ", " & Text1(0).Text & ". " & Text1(1).Text & " " & Text1(3).Text & ":" & Text1(2) & "."
    Close #1



    I changed the file type to APPEND
    if you open it for output..it will start a new file....append will add to it

    also..your SLASHES are backwards e:\etc...\etc...
    you have them like a URL
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7

    Thread Starter
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609
    Spend too long working on web pages me thinks
    thank you
    xxxxxxxxxxxxxxxxxx
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  8. #8
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    np!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread 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