Difference between revisions of "Command:If"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 23: Line 23:
 
*[[LavishScript:Mathematical Formulae|Mathematical Formulae]]
 
*[[LavishScript:Mathematical Formulae|Mathematical Formulae]]
  
{{Command-Stub}}
+
[[Category:LavishScript]] [[Category:Commands]]

Revision as of 21:28, 1 March 2005

Syntax

If <condition>

Description

Conditionally executes the following command, depending on the value of an expression. The condition is run through a math calculator. If the result is zero, the command is skipped; otherwise it is executed. Command blocks may be used, which begin with a { and end with a }, and is treated by control statements such as if it were a single command (i.e. executed or skipped as a whole).

When using characters which have special meaning in LavishScript commands, such as < | and >, enclose the statement in quotes (see Syntax).

 if "2 > 1"

Examples

 if x == 5
 {
   if y == 6
     varset z 17
 }
 else
   varset z 20

See Also