write to text file continuously


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: write to text file continuously

  1. #1
    Join Date
    Dec 2006
    Posts
    14

    write to text file continuously

    Hi, I am trying to read the serial number after reading from my device and write it to a txt file. But i can only write the last device serial number to the text file only. How do i write the text file continuously? What i am getting now is only SBBBB. SAAAA is overwritten. Please help me. Thank you

    Eg, (write to the text file)
    SAAAA
    SBBBB


    Code:
    Set fs = CreateObject("Scripting.FileSystemObject")
             Set f = fs.CreateTextFile("c:\Write_FIB\PASS.txt", True)
              f.WriteLine (txtSerialNo.Text)
              f.Close

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    CreateTextFile creates a new, empty file each time you call it. You need to use the OpenTextFile method instead:

    Const fsoForAppending = 8
    Set f = fs.OpenTextFile("c:\Write_FIB\PASS.txt", fsoForAppending, True)

    For more information, see http://www.4guysfromrolla.com/webtec...ect/faq3.shtml .
    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!

Similar Threads

  1. Text file update Access Table
    By charligov in forum VB Classic
    Replies: 2
    Last Post: 01-22-2007, 11:00 AM
  2. Randomized Results from multiple text files
    By LordNightwinter in forum VB Classic
    Replies: 1
    Last Post: 09-06-2006, 03:15 PM
  3. Replies: 0
    Last Post: 08-22-2000, 10:54 PM
  4. Replies: 1
    Last Post: 05-03-2000, 03:38 AM
  5. Replies: 0
    Last Post: 04-17-2000, 01:33 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