Adding strings to a file..


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Adding strings to a file..

  1. #1
    Join Date
    Jan 2009
    Posts
    23

    Adding strings to a file..

    I am trying clear out a file and then append two strings into a file.
    The file name is result.ini
    The first string is string1
    The second string is string2

    I suspect that this is very easy but having a braindrain.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Try this:
    Code:
    Dim FileHandle As Integer
    
    ' Get next available file handle
    FileHandle = FreeFile
    ' Opening a handle for Output clears all data
    ' or creates file if it does not exist
    Open "result.ini" For Output As FileHandle
    Print #FileHandle, "string1"
    Print #FileHandle, "string2"
    Close FileHandle
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  4. #4
    Join Date
    Jan 2009
    Posts
    23
    Thanks. Have done it many time before. Just couldn't remember.

Similar Threads

  1. Adding library file
    By stece in forum ASP.NET
    Replies: 0
    Last Post: 04-17-2007, 01:59 PM
  2. Replies: 9
    Last Post: 02-21-2007, 02:53 AM
  3. Replies: 0
    Last Post: 02-12-2006, 06:27 PM
  4. upload an image file and save on webserver.
    By sandhyaharsh in forum Java
    Replies: 0
    Last Post: 11-15-2005, 06:23 AM
  5. Replies: 1
    Last Post: 08-18-2005, 06:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center