I want to create a method to append lines to a text file:

The first code I pulled from google:

To create a simple log file for debugging Aarons script:

DIM logFSO, logFile

Set logFSO = CreateObject("Scripting.FileSystemObject")

Set logFile = logFSO.CreateTextFile( "c:\VSScriptLog.txt", True)

[Above just goes high in the script to be executed once when loaded]

logFile.WriteLine("Logged ok") 

[Above goes wherever i want to print a line to the log]

logFile.Close 

 [Where do I put the close for the file in a script so it closes when the
script is done]

Or with the file options can i just have a method:

High in code:

DIM logFSO, logFile

Set logFSO = CreateObject("Scripting.FileSystemObject")

Then:

in a print Sub:

Set logFile = logFSO.CreateTextFile( "c:\VSScriptLog.txt", True)

logFile.WriteLine("Logged ok") 

logFile.Close 

End Sub

I want to just append lines to a text file upon a WriteLine method of the
fso object for debugging.

Rick USA

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com/attachments/20150319/530eede4/attachment.htm>
_______________________________________________
Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of Ai Squared.

For membership options, visit 
http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/archive%40mail-archive.com.
For subscription options, visit 
http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com
List archives can be found at 
http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com

Reply via email to