CStats:SetRect CStats:GetErrMsg

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.

Syntax

sMsg = CStats:GetErrMsg()

Remarks

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.

Example

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

 

Related Topics

CStats, GetErrMsg