bValue = PmBuffer.GetLastError(false)
|bClear||[optional] (Boolean) Specifies whether to zero the error flag after reading it.|
false - The flag is not zeroed (stays unchanged) after reading.
true (default) - The flag is zeroed after reading.
It may be quite elaborate to test this after each operation, so there is a more simple way to do this. By this method, it is possible to check if error occured after all operations are completed. This error is deleted after calling this method with true parameter.
var buf = Pm.CreatePmBuffer();
var nVal = buf.GetInt32(0); //Invalid calling. The buffer contains only 2 bytes so it is not possible to read 4 bytes.
var nErr = buf.GetLastError(); //Returns non-zero value - flag indicating that an error occured. By calling it, the internal flag is zeroed.