OpenLog |
Top Previous Next |
×V2.1Ø
Syntax - OpenLog <FileID> <LogFilePath> [<LogMode>] Where: <FileID> is a literal string, a variable that contains a literal string or an integer, a variable that contains an integer or an unquoted user defined name assigned to the file <LogFilePath> is a valid path and file name that is accessible from the workstation on which EMUE is running. <LogMode> is one of the following keywords or a variable that contains one of these keywords: APPEND, OVERWRITE.
Description: This command assigns a <FileID>, which is a nickname that will be used to identify the log file, and opens the file. <LogMode> determines whether info will be appended to the log file or it will overwrite what is already there. The key term #TODAY# can be used in the literal string that defines the <LogFilePath> to insert the current date in file name. The key term #TODAY# is replaced with the current date in the format MMDDYY. The key term #TIME# can be used in the literal string that defines the <LogFilePath> to insert the current time in file name. The key term #TIME# is replaced with current time in the format HHMMSS. The key term #INPUTFILENAME# can be used in the literal string that defines the <LogFilePath> to insert the file name defined in the SetStartup InputFile command into the file name. The key term #INPUTFILENAME# is replaced with the file name defined in the SetStartup InputFile command without its extension. The key term #SCRIPTFILENAME# can be used in the literal string that defines the <LogFilePath> to insert the script file name without extension into the file name. The key term #SCRIPTFOLDER# can be used in the literal string that defines the <DestinationFilePathAndName> to insert the folder path where the script file is located. The key term #COMPUTERNAME# can be used in the literal string that defines <DestinationFilePathAndName> to insert the name of the computer where the script is running.
Notes: The log file must be opened with OpenLog before it can be written to. If the user defined name is the same as a variable that is currently in the script, then the contents of the variable will be used as the <FileID>
Note: This feature is not supported in EMUE Standard.
Sample: The following statements show 4 different ways to open and assign a <FileID> to a log file. REM Open a log file and use a string to identify the file OpenLog "File 1" "C:\EMUE\Script1\LogFiles\Log_#TIME#_#DATE#.txt" REM Open a log file and use a number to identify the file OpenLog 2 "C:\EMUE\Script1\LogFiles\Log2.txt" REM Open a log file and use a variable to identify the file Copy fileVar "File 3" OpenLog fileVar "C:\EMUE\Script1\LogFiles\Log3.txt" REM Open a log file and use a user defined name to identify the file OpenLog Output "C:\EMUE\Script1\LogFiles\Log2.txt" REM This line writes to the log file and includes a new line character at the end. WriteLogLine "File 1" "Patient ID: " PTID REM Since "File 1" was created with a time and date stamp, the actual name of the is unknown REM Use GetLogName to retrieve the name of the file and store it in a variable GetLogName fileToEmail "File 1" CloseLog "File 1" REM Now the file can be e-mailed. SendEmail "someone@company.com" "Using Multiple Log files" "Attached is one of the additional logs used in the script" fileToEmail
See Also:
|