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.
sMsg = CStats:GetErrMsg() |
Returns 0 if the last statistics calculation succeeded.
Otherwise, returns an error code.
The 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 fragment checks the MinMaxClipMean calculation for success and prints an error message if it failed:
S = CStats:new() |
-- create a CStats object |
S:Init( I, R ) |
-- specify CImage and CRect to measure |
nVal = S:MinMaxClipMean() |
-- returns the mean value |
if ( S:GetStatus() ) then |
-- if calculation failed, this returns nonzero |
Msg( S:GetErrMsg() ) |
-- show the error message |
end |
|