
66
Class Reference
Format:
function filterCommand(commandType, commandData)
{
var shouldSuppressCommand = false;
/* Processing statements */
return !shouldSuppressCommand;
}
reader.onCommand = filterCommand;
Where:
commandType
– string; 1 character; specifies the command being processed.
commandData
– string; data to be process by the command.
Example:
function notifyErase(commandType)
{
if ( commandType == ')' )
print("Erasing Error Log...");
}
reader.onCommand = notifyErase;
Sends a debugging message to the host to show that the erase command was detected.
4.3.2.2
onCommandFinish
The
onCommandFinish
property of the
reader
object provides processing control upon
completion of a command.
Format:
function finishedCommand(commandSuccess,
responseType,
responseData)
{
/* Processing statements */
}
reader.onCommandFinish = finishedCommand;
Where:
commandSuccess
– Boolean; contains the return status of the command: true = success,
false = failure.
responseType
– string; 1 character; specifies the response type.