{"identifier":26805,"topic":"Keywords","name":"if (single-statement)","text":"<code><pre>if <i>trueOrFalse<\/i> then <i>statements<\/i> \u00ac\n<\/pre><\/code>\n<code>   <\/code>[<code>else <i>statements<\/i><\/code> ] <br><br>\n\n <code><pre>if <i>trueOrFalse<\/i> \nthen <i>statements<\/i>\n<\/pre><\/code>[<code>else if <i>trueOrFalse<\/i><u> <\/u>then <i>statements<\/i><\/code> ]<code> <\/code>[<code>else <i>statements<\/i><\/code> ] <br><br>\n\n The single-statement<code> if <\/code>structure tests for a condition and executes <b>one<\/b> statement if the condition is true. You use the optional<code> else if <\/code>or<code> else <\/code>form to run other  blocks of code in case the  condition following<code> if <\/code>is false. <br>\n<br>\nBecause each part of a simple<code> if <\/code>structure is limited to one statement, you don't need an<code> end if <\/code>statement. <br><br>\n\n You can send a one-line <code>if <\/code>structure from the Message box. <br>\n","related":{"89783":"Comparison operators","90049":"Logical operators","6157":"Type and existence operators"},"examples":"if it is empty then exit myHandler\n\nask file \"Save information to file:\"\nif it is empty then exit myHandler \nelse saveFile it\n\nask file \"Save information to file:\"\nif it is empty \nthen exit myHandler \nelse saveFile it","demo":"","debug":{"9":["if trueOrFalse then "],"10":["Because each part of"]}}