17 file functions, 1 openfile() – Teledyne LeCroy Verification Script Engine for Teledyne LeCroy PETracer Reference Manual User Manual

Page 70

Advertising
background image

Teledyne LeCroy

Verification Script Engine Reference Manual

Version 6.6x

65

17 File Functions


This group of functions covers VSE capabilities to work with the external files.


17.1 OpenFile()


This function opens a file for writing.


Format:

OpenFile( file_path, append )


Parameters:

file_path

Full path to the file to open. (For ‘\’ use ‘\\’ )

append

This parameter (if present and not equal to 0) specifies that VSE should
append to the contents of the file. Otherwise, the contents of the file are overwritten.


Return Values:

The “handle” to the file to be used in other file functions.


Example:

set file_handle = 0;

file_handle = OpenFile( “D:\\Log.txt” ); # Opens file, the previous contents

# are erased.


WriteString( file_handle, “Some Text1” ); # Write text string to file
WriteString( file_handle, “Some Text2” ); # Write text string to file

CloseFile( file_handle ); # Closes file


# Opens file, the following file operations append to contents of the file.

file_handle = OpenFile( GetApplicationFolder() + “Log.txt”, _APPEND );

Advertising