Server.CreateObject (

Results 1 to 2 of 2

Thread: Server.CreateObject (

  1. #1
    Join Date
    Dec 1969

    Default Server.CreateObject (

    In the loop, when the letter "A" appear I want to print spaces but it seems that the method reads the first character and passes to the other without any occasion to come back to the first character of the line and print it to the page.<BR>So if you have any idea it would be appreciated!!!<BR><BR>Here the code :<BR>set fs = Server.CreateObject ("Scripting.FileSystemObject")<BR>set auto = fs.OpenTextFile ("c:InetpubInternetpublic_htmlsport.txt",,Tristate UseFalse)<BR>set objNewFile = auto.OpenAsTextStream(ForWriting,TristateUseDefaul t)<BR>Response.Write "&#060;p&#062;"<BR><BR>Do while not auto.AtEndofStream<BR>If auto.Read(1) = "A" then Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;"<BR>&#039Writing the line with the first letter<BR>End IF<BR>Response.write auto.ReadLine<BR>loop<BR><BR>Thanks<BR>Chris

  2. #2
    shaffer Guest

    Default RE: Server.CreateObject (

    Hi Chris,<BR><BR>It would be MUCH MUCH faster to read the entire file into a string buffer (perhaps called strBuffer) and then do:<BR><BR> response.write replace(strBuffer, "A", " ")<BR><BR><BR>- Mike

Posting Permissions

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