Run code if a statement is true.
statement: A statement to evaluate. The statement must evaluate to
False. Statements can also be comparisons using
...: An arbitrary number of commands indented with a tab character. These commands are run if the
ifstatement evaluates to
The following example loads an image, reads the text in the image, and shows the image if it contains "tea".
Load["./photo.jpg"] GetText If[Read == "tea"] Show
In this example,
Read == "tea" is the statement to evaluate. If this statement returns
True, the indented statements are run. Otherwise, the indented statements are not run.