From QB64.org wiki
The END IF statement ends a multiple line IF block statement.
- END IF
- END IF is required for any multiple line IF, ELSEIF or ELSE statement blocks.
- It is also required after any multiple line code executions performed after evaluation.
- The IDE may point to an error in a loop or somewhere else if you forget to use END IF (typically a PROGRAM FLOW ERROR! message).