Results 1 to 2 of 2

Thread: TextStream Object

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2001
    Posts
    19

    TextStream Object

    I just started learning about the FileSystemObject and have a few questions.
    What is the difference between using the FSO createtextfile and the Output method or the opentextfile and the Input method, I mean why use one over the other. eg

    PHP Code:
        dim OStream as TextStream
        set OStream
    =fso.CreateTextFile("c:\testFile.txt",true,false)
        
    OStream.WriteLine text1
       
    or
      
       
    file=freefile
       strFile 
    "c:\testFile2.txt"
        
    Open strFile For Output As #File
            
    Print #File, text1
        
    Close #File 
    Just curious.

  2. #2
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    this is OLD VB

    Code:
    file=freefile
       strFile = "c:\testFile2.txt"
        Open strFile For Output As #File
            Print #File, text1
        Close #File
    Now this takes advantage of MS COM component thus being faster and efficient!
    Code:
    dim OStream as TextStream
        set OStream=fso.CreateTextFile("c:\testFile.txt",true,false)
        OStream.WriteLine text1

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