<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE> {The S-lang C Library Reference}: SLang_verror</TITLE>
<LINK HREF="cref-83.html" REL=next>
<LINK HREF="cref-81.html" REL=previous>
<LINK HREF="cref.html#toc82" REL=contents>
</HEAD>
<BODY>
<A HREF="cref-83.html">Next</A>
<A HREF="cref-81.html">Previous</A>
<A HREF="cref.html#toc82">Contents</A>
<HR>
<H2><A NAME="SLang_verror"></A> <A NAME="s82">82. <B>SLang_verror</B></A></H2>

<P>
<DL>
<DT><B> Synopsis </B><DD><P>Signal an error with a message
<DT><B> Usage </B><DD><P><CODE>void SLang_verror (int code, char *fmt, ...);</CODE>
<DT><B> Description </B><DD><P>The <CODE>SLang_verror</CODE> function sets <CODE>SLang_Error</CODE> to
<CODE>code</CODE> if <CODE>SLang_Error</CODE> is 0.  It also displays the error
message implied by the <CODE>printf</CODE> variable argument list using
<CODE>fmt</CODE> as the format.
<DT><B> Example </B><DD><P>
<BLOCKQUOTE><CODE>
<PRE>
      FILE *open_file (char *file)
      {
         char *file = "my_file.dat";
         if (NULL == (fp = fopen (file, "w")))
           SLang_verror (SL_INTRINSIC_ERROR, "Unable to open %s", file);
         return fp;
      }
</PRE>
</CODE></BLOCKQUOTE>
<DT><B> See Also </B><DD><P><CODE>SLang_vmessage, SLang_exit_error</CODE>
</DL>
<P>
<P>
<P>
<HR>
<A HREF="cref-83.html">Next</A>
<A HREF="cref-81.html">Previous</A>
<A HREF="cref.html#toc82">Contents</A>
</BODY>
</HTML>
