CStats:GetStatus
The GetStatus method returns a status for the last statistics calculation. A value of 0 indicates success and other values correspond to an error condition.
nStatus = CStats:GetStatus() where |
nStatus is the status number from the most recent calculation. If no eror occured, 0 is returned.
CStats calculations return a value and not an error message. If you wish to check the result of a calculation, call this method to get the status code. if the status code is not 0, you can fetch the error message using GetErrMsg. Note:This method also returns 0 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 calculation failed, this returns nonzero |
|
-- show the error message |
|
|