Texas Instruments TI-89 Manuel D’Utilisation
![Texas Instruments](https://files.manualsbrain.com/attachments/b46f99d826b2b0e0e5f558c5fb6483942eb9216b/common/fit/150/50/c15ea36eb1fb1cce99a3b94668675bfc78ce832d8d727d9a7bb51a125510/brand_logo.gif)
Programming
607
If Command
If Command
If Command
If Command
To execute only one command if a conditional test is true, use the general form:
Ê
Executed only if x>5; otherwise, skipped.
Ë
Always displays the value of x.
In this example, you must store a value to x before executing the
If
command.
Note:
Use indentation to make your programs easier to read and understand.
If...Then...EndIf Structures
If...Then...EndIf Structures
If...Then...EndIf Structures
If...Then...EndIf Structures
To execute one group of commands if a conditional test is true, use the structure:
Ê
Executed only if x>5.
Ë
Displays value of:
• 2x if x>5
• x if x
• x if x
{
5
Ê
Ë
:If x>5
: Disp "x is greater than 5"
:Disp x
Ê
Ê
Ë
:If x>5 Then
: Disp "x is greater than 5"
: 2
†
x
!
x
:EndIf
:Disp x