GetLastError method

The GetLastError method retrieves the text of the last error that is encountered during a DCO read operation or write operation, and clears the error.

Before you call the GetLastError method, you can check whether an error string exists by calling the IsError method.

Syntax

VBScript
objRTBatch.GetLastError as Boolean
C#
string GetLastError()

Arguments

None.

Returns

Returns true if successful; returns false if unsuccessful.

Applies to

Batch objects only.

VBScript example

objBatch.BatchDir = c:\Datacap\MQSW\Batches
bStatus = objBatch.Write rulerunner.xml
If bStatus <> True Then
   msgbox objBatch.GetLastError
End if