Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    TextStream (XP/2K)

    What am I doing wrong here?


    Const ForReading = 1, ForWriting = 2, ForAppending = 3
    Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
    Const StrPad4 = " ", StrPad3 = " ", StrPad2 = " ", StrPad10 = " " ' these are to use to pad strings that are not used


    Dim fs, f, ts, s
    strFileName = strDirectory & "test1.txt"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set s = fs.CreateTextFile(strFileName) 'Create a file
    Set f = fs.GetFile(strFileName)
    Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)

    It crashes on the last line.
    IS there a good place to learn this code on the web?
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TextStream (XP/2K)

    I don't know the answer to your question, but MSDN has a section on Script Runtime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •