Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > 00b22311ee5115bec2c62951147eb789 > files > 76

yodl-1.31.18-14mdv2008.1.x86_64.rpm

<! banner_id >

The <code>IFZERO</code> macro expects three parameter lists, just as the other
<code>IF...</code> macros: a symbol, a true-list and a false-list. 

The first argument defines whether the whole macro expands to the true-list or
to the false-list. The first argument may be:

<dl>

<li > Nothing (empty): the macro expands to the true-list.

<li > A number: when zero, the macro expands to the true-list.

<li > The name of a counter: when the value of the counter is zero, the
    macro expands to the true-list. 

<li > Anything else: the macro expands to the false-list.

</dl>

You can use <code>COUNTERVALUE(somecounter)</code> as the argument to <code>IFZERO</code>, it is
treated in the same manner as the corresponding counter name. 

Example: The <code>IFZERO</code> macro offers a very simple way to pass a flag-argument
(an on/off switch) to a macro. E.g., in LaTeX you start environments with
<code>\begin{environment}</code> and end them with <code>\end{environment}</code>;
<code>environment</code> being e.g., <code>center</code>, <code>flushright</code>, <code>flushleft</code>. A
possible meta-macro for the environments might be:

<pre>
DEFINEMACRO(environment)(2)(\ 
    IFZERO(ARG2)\ 
        NOEXPAND(\end{ARG1})\ 
        NOEXPAND(\begin{ARG1}))
</pre>

<p>Such a macro may be used as:
<p><pre>
environment(center)(1)
Now comes centered text.
environment(center)(0)
</pre>

<p>which would of course lead to <code>\begin</code> and <code>\end{center}</code>. The numeric
second argument is used here as a on/off switch.
<!--

if this file ./Documentation/footer.html.in is present, it is included

automatically by add-html-footer, and replaces the simple standard
footer substitutions:

 * index,
 * package name
 * package name
 * ENV:WEBMASTER,
 * ENV:WEBMASTER

-->

<hr>
Go <a href=>back</a> to index of Yodl.

<p>
Please send Yodl questions and comments to 

<a href="mailto:yodl@icce.rug.nl">
<em>yodl@icce.rug.nl</em></a>.
<p>

<!-- package Yodl Yodl -->

Please send comments on these web pages to 
<a href="mailto:(address unknown)"><em>(address unknown)</em></a>



<p>

Copyright (c) 1997, 1998, 1999 Karel Kubat and Jan Nieuwenhuizen.

<p>

Verbatim copying and distribution of this entire article is 
permitted in any medium, provided this notice is preserved.<p>

<hr><font size=-1>
This page was built from Yodl-1.31.18 by 
<address><br> &lt<a href=\"mailto:(address unknown)\">(address unknown)</a>&gt,  Wed Mar  5 04:36:20 2008 EST.</address><p></font></BODY>
</html>