Repository URL to install this package:
|
Version:
4.4.5.dfsg-3ubuntu2 ▾
|
<HTML>
<HEAD>
<TITLE>Conditional statements</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<P><A NAME="execifthen"></A>
<font size="+3" color="green"><B>Conditional statements</B></font></P>
<P>
<CODE>IF...THEN</CODE> statements can only
be used in script files. The general form of an
<CODE>IF...THEN</CODE> statement is:</p>
<p>
<CODE>IF (boolean) THEN</CODE></P>
<P>
The <CODE>boolean</CODE> can take any form, but
must be enclosed in parentheses, and it must have a scalar result. A result
of <CODE>1</CODE> is true, while anything else is false. An
<CODE>IF...THEN</CODE> statement can precede a
single command. An <CODE>IF...THEN</CODE> statement
can begin a block of commands, but in that case it must be terminated with an
<CODE>ENDIF</CODE> statement. Nested <CODE>IF...THEN</CODE> statements are allowed.</P>
<P>
<font size="+2" color="green">Example</font></P>
<font color="blue"><PRE>
...
IF (A>B) THEN TEXT 'A > B'
IF (A=B) THEN TEXT 'A = B'
IF (A<B) THEN TEXT 'A < B'
...
</PRE></font>
<P><font size="+2" color="green">Example</font></P>
<font color="blue"><PRE>
...
IF (A>B) THEN
...
ENDIF
...
</PRE></font>
<P><font size="+2" color="green">Example</font></P>
<font color="blue"><Pre>
...
START2:
IF (J<=8) THEN
...
J=J+1
GOTO START2
ENDIF
...
</PRE></font>
<P>
<a href="ExecuteS06.htm"><img src="../shadow_left.gif">
<font size="+1" color="olive">Looping</font></a>
</P>
</BODY>
</HTML>