if

if - Execute code conditionally



Description

Examines the supplied conditional and executes the following code if the result is true.

Syntax

if { <conditional statement> } {
  <command(s)>
}

if

  • Examines the supplied conditional and executes the following code if the result is true.

Examples

if { <expression> } {
  <statement_command>
} elseif { <expression> } {
  <statement_command>
} else {
  <statement_command>
}