Difference between revisions of "Command:If"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 5: Line 5:
 
== Description ==
 
== Description ==
 
Conditionally executes a group of statements, depending on the value of an expression.
 
Conditionally executes a group of statements, depending on the value of an expression.
 +
 +
When using characters with special values, such as '<', enclose the statement in quotes.
 +
  if "2 > 1"
  
 
== Examples ==
 
== Examples ==

Revision as of 20:25, 1 March 2005

Syntax

if (condition) statement1
[else statement2]

Description

Conditionally executes a group of statements, depending on the value of an expression.

When using characters with special values, such as '<', enclose the statement in quotes.

 if "2 > 1"

Examples

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

See Also