From QB64 Phoenix Edition Wiki
Jump to navigation
Jump to search
|
|
Line 1: |
Line 1: |
| #REDIRECT [[IF...THEN]] | | #REDIRECT [[IF...THEN]] |
|
| |
|
| |
| [[IF]] statements make Boolean True or False program evaluations to automate program decision making.
| |
|
| |
| {{PageSyntax}}
| |
| : [[IF]] evaluation [[THEN]] {{Parameter|{code}}}
| |
|
| |
| * The evaluation by [[IF]] must be true for the {{Parameter|{code}}} to be run.
| |
| * IF statements can also have alternative evaluations using [[ELSEIF]] and [[ELSE]] conditions.
| |
| * When the '''IF''' statement and/or code to be run is more than one line of code, an [[END IF]] statement must be used.
| |
| * With multiple code lines to run, end the IF statement with THEN and place all of the code on lines below that line.
| |
| * With multiple code lines to run (an [[IF...END IF]] block), the IF statement and END IF statement must be the first statement on the line.
| |
| * The IDE may point to an [[ERROR Codes|error]] in a loop or somewhere else if you forget to use END IF (typically a ''PROGRAM FLOW ERROR!'' message).
| |
| * Use [[colon]]s to execute multiple statements after [[THEN]].
| |
|
| |
|
| |
| {{PageSeeAlso}}
| |
| [[IF...THEN]]
| |
|
| |
|
| |
| {{PageNavigation}}
| |
Latest revision as of 11:00, 23 January 2023