old-www/LDP/nag/node103.html

39 lines
1.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-c (Feb 29, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>The if and goto Commands</TITLE>
</HEAD>
<BODY LANG="EN">
<A HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <BR>
<B> Next:</B> <A HREF="node104.html">sendwait and sleep</A>
<B>Up:</B> <A HREF="node97.html">A dip Reference</A>
<B> Previous:</B> <A HREF="node102.html">Variable Names</A>
<BR> <P>
<H3><A NAME="SECTION009326000">The if and goto Commands</A></H3>
<P>
The if command is rather a conditional branch than
what one usually calls an if. Its syntax is
<P>
<pre>
if var op number goto label
</pre>
<P>
where the expression must be a simple comparison between one of the
variables $errlvl, $locip, and $rmtip.
The second operand must be an integer number; the operator op may
be one of <code>==</code>, <code>!=</code>, <code>&lt;</code>, <code>&gt;</code>, <code>&lt;=</code>, and
<code>&gt;=</code>.
<P>
The goto command makes the execution of the script continue at
the line following that bearing the label. A label must occur as the very
first token on the line, and must be followed immediately by a colon.
<P>
<BR> <HR>
<P><ADDRESS>
<I>Andrew Anderson <BR>
Thu Mar 7 23:22:06 EST 1996</I>
</ADDRESS>
</BODY>
</HTML>