CStats:GetStatus

CStats:GetErrMsg


The GetErrMsg method returns the error message when a statistics calculation fails.

Syntax

sMsg = CStats:GetErrMsg()

Remarks

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.

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 stats calculation failed, this returns non 0

  Msg( S:GetErrMsg() )

-- show the error message

end

 

Related Topics

CStats, GetStatus