Results 1 to 4 of 4

Thread: Saving Files

  1. #1
    Guest
    Hi all,

    I'm trying to save a file that contains two lines of information. One line is the Sender's name, the next line is the receiver's name.

    However, when i save the file, it appends quotaion marks ("") to the beginning and end of each lin. How do I prevent this from happening?

    thanx

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Angry

    what method are you using, Binary, Output, or Input or whatever. Because it depends on that, or it might depend on the method u write to the file. There's print, line...
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  3. #3
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Use this:

    Open "c:\foo.dat" for Output As #1
    Print #1, SenderName
    Print #1, RecieverName
    Close #1

    If you want to add those two lines to the end of c:\foo.dat, use the code:

    Open "c:\foo.dat" For Append As #1
    Print #1, SenderName
    Print #1, RecieverName
    Close #1

    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Shoudn't be hard
    Code:
    open file for output as #1
        Print line1
        Print line2
    close #1
    use append instead of output if you don't want it to overwrite, don't use binary if this is the only purpose of the file
    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