File functions, Openfile(), 17 file functions – Teledyne LeCroy SATracer 3G Verification Script Engine manual User Manual
Page 54: 1 openfile()
![background image](/manuals/353603/54/background.png)
LeCroy Corporation
Verification Script Engine Reference Manual
Version 1.01
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 - the 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 will be 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 will be
# 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 will append to the contents of
the file.
file_handle = OpenFile( GetApplicationFolder() + “Log.txt”, _APPEND );
49