CStats:GetErrMsg
The GetErrMsg method returns the error message when a statistics calculation fails.
sMsg = CStats:GetErrMsg() where |
sMsg is the returned error message. If no error occurred in the last calculation, an empty string, "", is returned.
Each CStats calculation returns a value and not a status code. If you wish to check the result of a calculation, check GetStatus for a non zero value. If it is non-zero, you can fetch the error message using GetErrMsg. Note: This method also returns an empty string if there is no CStats object.
The following script checks the MinMaxClipMean calculation for success and prints an error message if it failed:
|
-- create a CStats object |
|
-- specify CImage and CRect to measure |
|
-- returns the mean value |
|
-- if stats calculation failed, this returns non 0 |
|
-- show the error message |
|
|