From QB64 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 Qbasic IDE may point to an error in a loop or somewhere else if you forget to use END IF!