EasyManuals Logo
Home>Texas Instruments>Calculator>TI-89

Texas Instruments TI-89 Guide Book

Texas Instruments TI-89
623 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #312 background imageLoading...
Page #312 background image
Chapter 17: Programming 295
17PROGRM.DOC TI-89/TI-92 Plus: Programming (English) Susan Gullord Revised: 02/23/01 1:14 PM Printed: 02/23/01 2:18 PM Page 295 of 40
To enter
If...EndIf
structures, use
the Program Editor’s
Control
toolbar menu.
The
If
command is available
directly from the
menu.
To see a submenu that lists other
If
structures, select
2:If...Then
.
When you select a structure such as
If...Then...EndIf
, a template is
inserted at the cursor location.
:If
|
Then
:EndIf
To execute only one command if a conditional test is true, use the
general form:
:If x>5
: Disp "x is greater than 5"
:Disp x
In this example, you must store a value to
x
before executing the
If
command.
To execute multiple commands if a conditional test is true, use the
structure:
:If x>5 Then
: Disp "x is greater than 5"
: 2
ù
x
!
x
:EndIf
:Disp x
Using If, Lbl, and Goto to Control Program Flow
An
If...EndIf
structure uses a conditional test to decide
whether or not to execute one or more commands.
Lbl
(label)
and
Goto
commands can also be used to branch (or jump)
from one place to another in a program.
Control Toolbar
Menu
If Command
Tip: Use indentation to
make your programs easier
to read and understand.
If...Then...EndIf
Structures
Note:
EndIf
marks the end
of the
Then
block that is
executed if the condition is
true.
Executed only if x>5;
otherwise, skipped.
Always displays the value of x.
Executed only if x>5.
Displays value of:
2x if x>5.
x if x
5.
The cursor is positioned so
that you can enter a
conditional test.

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals