Results 1 to 4 of 4

Thread: So wait, how do you...?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    99
    How do you open a text file, add lines/stuff to it, and save it?
    ___________________________
    Chris

  2. #2
    Guest
    Append to a file.

    Code:
    Open "C:\MyTextFile.txt" For Append As #1
    Print #1, "My added text"
    Close #1
    This will add text to the end of a file.

  3. #3
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Code:
    Open FileName For Action {Append, Input, Output, Binary, Random}  As FileNum (Use FreeFile Function)
    
    'For Text File, ex.
    Dim FileNum As Integer
    
    FileNum = FreeFile
    
    Open "C:\MyFile.txt" For Append As #FileNum
    
    Print #FileNum, "This is some Sample Text"
    
    Close FileNum
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You could read my file tutorial on my homepage, it covers the most basic things about files
    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