Artifact 01845011d1431bda9624769c3a6768da5bd45c1999062d09213982e9afefb2b7:
- Executable file
r37/lisp/csl/html/r37_0131.html
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1506) [annotate] [blame] [check-ins using] [more...]
<A NAME=REDERR> <TITLE>REDERR</TITLE></A> <b><a href=r37_idx.html>INDEX</a></b><p><p> <B>REDERR</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>command</B><P> <P> <P> <P> The <em>rederr</em> command allows you to print an error message from inside a <A HREF=r37_0055.html>procedure</A> or a <A HREF=r37_0041.html>block</A> statement. The calculation is gracefully terminated. <P> <H3> syntax: </H3> <P> <P> <em>rederr</em><message> <P> <P> <P> <message> is an error message, usually inside double quotation marks (a <A HREF=r37_0003.html>string</A>). <P> <P> <P> <H3> examples: </H3> <P><PRE><TT> procedure fac(n); if not (fixp(n) and n>=0) then rederr "Choose nonneg. integer only" else for i := 0:n-1 product i+1; fac fac a; ***** Choose nonneg. integer only fac 5; 120 </TT></PRE><P>The above procedure finds the factorial of its argument. If n is not a positive integer or 0, an error message is returned. <P> <P> If your procedure is executed in a file, the usual error message is printed, followed by <em>Cont? (Y or N)</em>, just as any other error does from a file. Although the procedure is gracefully terminated, any switch settings or variable assignments you made before the error occurred are not undone. If you need to clean up such items before exiting, use a group statement, with the <em>rederr</em> command as its last statement. <P> <P> <P>