FLSendCommand Method to send a script command to FileLink |
Top Previous Next |
Overview Method to send a script command.
C++ Definition long FLSendCommand( CString strCommand, long nTimeout )
VB Definition FLSendCommand( Command As String, Timeout As Long ) As Long
Return Value The numeric result code returned by FileLink after the execution of a script command.
Returns >= FL_ERROR_FROM_FILELINK if the command was executed successfully by FileLink. This value corresponds to one of FileLink's script command result codes.
Returns FL_ERROR_CMD_IN_PROGRESS if the command is non-blocking and the command has been successfully initiated.
Returns FL_ERROR_TIMED_OUT if the command timed out.
See COM/OLE Return Codes below for a complete list of possible return values.
Parameters strCommand / Command A string defining the FileLink script command to perform.
To have FileLink simulate line numbers in the log file, precede the command with #{number} and a space character.
nTimeout / Timeout
A long specifying the period of time (10th of seconds) to wait for a blocking Send() to complete. The parameter is ignored when the Send() is non-blocking.
Remarks The FLStartSession() method must be called prior to calling Send().
This method blocks or returns immediately depending the selection made in the FLStartSession() method.
If non-blocking is selected, the FLCommandResult() event is fired upon completion.
If you send a conditional command (e.g., IFFILE or IFERROR) the conditional element of the command is evaluated and a TRUE/FALSE result is passed back but no actual branching action is taken.
For example, if the following script command is sent to FileLink and the file exists FileLink returns $ERROR_OLE_COMPARISON_TRUE; if file does not exist, the return value is $ERROR_OLE_COMPARISON_FALSE. The goto portion of the command is ignored since FileLink really does not have a script file to branch within.
IFFILE "c:\Program Files\FileLink\thisfile" goto found it
If script labels are sent, they are ignored.
|