Sign in to follow this  
Followers 0
willwatters

Writing to file

2 posts in this topic

How do I write the following contents to a file (c:\Development\vbcommon\LogFile\AutoLab.txt) that has already been created and populated:

Test Number, Test Name, Test Status, Description, Severity.

Note: This information needs to be put at the end of the file.

Thanks,

Will

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How do I write the following contents to a file (c:\Development\vbcommon\LogFile\AutoLab.txt) that has already been created and populated:

Test Number, Test Name, Test Status, Description, Severity.

Note: This information needs to be put at the end of the file.

Thanks,

Will

<{POST_SNAPBACK}>

FileOpen(filename,mode)

filename Filename of the text file to open.

mode Mode (read or write) to open the file in.

  0 = Read mode

  1 = Write mode (append to end of file)

  2 = Write mode (erase previous contents)

Both write modes will create the file if it does not already exist.

FileWriteLine(filehandle,line)

filehandle The handle of a file, as returned by a previous call to FileOpen. Alternatively, you may use a string filename as the first parameter.

line The line of text to write to the text file. If the line does NOT end in @CR or @LF then a DOS linefeed (@CRLF) will be automatically added.

$file = FileOpen(c:\Development\vbcommon\LogFile\AutoLab.txt,1)
FileWriteLine($file,"text")
FileClose($file)
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0