Results 1 to 2 of 2

Thread: Writing to file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Location
    SLOVENIA, Europe
    Posts
    110
    Problem:

    I have string strData
    Every one second i do this:
    strData = strData & strNewdata

    So it becomes very big. Now I want to write every change into file:

    open myFile for Append as #1
    print #1, strNewdata

    But this writes unwanted newline to file so it looks like this:

    strData1strData1strData1strData1strData1strData1
    strData1strData1strData1strData1strData1
    strData2
    strData2strData2strData2strData2strData2strData2
    strData2strData2

    I want to look it like this:

    strData1strData1strData1strData1strData1strData1
    strData1strData1strData1strData1strData1strData2
    strData2strData2strData2strData2strData2strData2
    strData2strData2

    Please help!
    Ermin Gutenberger

    VB.NET 2010

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    a semicolon should avoid an extra line
    Code:
    print #1,strdata;
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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