Click to See Complete Forum and Search --> : Need Help


cns187
04-18-2006, 10:34 AM
what will be displayed when this script is executed

<%
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set filetxt = objFSO.CreateTextFile("c:\a\file1.txt",true)
filetxt.Write("SQL is a query,")
filetxt.WriteLine("language")
filetxt.WriteLine("used to")
filetxt.WriteLine("retrieve information")
filetxt.WriteLine("and update")
filetxt.WriteLine("the database")
filetxt.Close
%>

candelbc
04-18-2006, 10:54 AM
This creates a file on the Server's Hard drive called c:\a\file1.txt and writes each of those lines..

cns187
04-18-2006, 11:04 AM
when it writes each of those lines does it create a new line for each

eg..

>sql is a query
>language
>used to
>.....
>.....
>...


or


is it on one continuous line : sql is a query language used to

Ubik
04-18-2006, 01:43 PM
This looks suspiciously like homework, and to answer your original question (what will be displayed when this script is executed): 'Nothing' because it is not writing anything to the browser.

The answer to your second question:

Write: Writes a specified text to a file...
WriteLine: Writes a specified text and a new-line character to a file...

The output will be:

sql is a query,language
used to
.....
.....
...