CoCoA:Error

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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>