CoCoA:Error

From ApCoCoAWiki

Error

return an error message

Description

This function returns an error labeled with the string S.

To get S use <ttref>GetErrMesg</ttref>.

Example

  Define T(N)
    If Type(N) &lt;&gt; INT Then Error(<quotes>Argument must be an integer.</quotes>) EndIf;
    Return Mod(N,5);
  EndDefine;
  T(1/3);

-------------------------------
ERROR: Argument must be an integer.
CONTEXT: Error(<quotes>Argument must be an integer.</quotes>)
-------------------------------
  T(7);
2
-------------------------------

Syntax

Error(S:STRING):ERROR

Catch

GetErrMesg

   <type>error</type>