FANDOM


:If condition:Then:commands:End

When placed after an If command, separated by a colon, will perform the commands between the Then and End commands, but only if the boolean following the If command evaluates to true.

If this is not followed by an End command, the program will end if the condition is false.

Location Edit

  • Prgm
  • CTL
  • 2:Then

Example Edit

:Input "NUMBER",X
:If X=5
:Then
:Disp "YOUR NUMBER IS 5"
:End
:Disp "YOU ENTERED A NUMBER"

This program will ask the user to input a number. It will display the text "YOUR NUMBER IS 5" only if the number the user enters is 5. It will display "YOU ENTERED A NUMBER" whether the input was 5 or not.