411 REFERENCE · Wikibooks
TI-Basic 84 Programming/Control Flow Statements
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
If
If, PRGM:CTL:1 is a command that, when it's condition is true, will execute the next line of code. If the condition happens to be false, then the program will skip to the second line of code after the statement.
Syntax: If
If condition Where condition either an (in)equality (X=3, A>B), or an expression (5+2X), which resolves to be either true (non-zero) or false (zero).
Ex: If
TEMP 5→X
If X>3
Disp "X IS MORE THAN 3"
Disp "END OF PROGRAM" X IS MORE THAN 3
END OF PROGRAM
Else
Else, PRGM:CTL:3 is a command that, when a previous If statement is not met, will execute the next line of code. If the condition happens to be false, then the program will skip to the second line of code after the statement.
Syntax: Else
If condition
Then
//some action
Else
//some other action Else executes when the condition in the If statement is not met.
Ex: Else
TEMP 5→X
If X>3
Then
Disp "X IS MORE THAN 3"
Else
Disp "X IS LESS THAN OR EQUAL TO 3"
Disp "END OF PROGRAM" X IS MORE THAN 3
END OF PROGRAM
Then
Then, PRGM:CTL:2 is a command used to have a conditional statement (If or Then) execute a block of code as opposed to a single statement.
Syntax: Then
If condition
Then
//some code
//some more code
End Code block is started with a Then statement and ended with the End, PRGM:CTL:7
Input Test Conditions and Logical Operators