Resources
Policy
Links
Tasks
Calculators
Support Documents

Home | Calculators | Texas Instruments - Mathematics | Transfer of Control

Transfer of Control

A routine can now be written to allow the user to choose to continue the program or stop. This involves using a Goto command and a matching label

The command Goto needs to be inserted at the end of each of the If Then routines. Scroll up to the end statement of the first If Then statement and move the cursor to the end of the line.
Press 2nd   INS and ENTER
Choose PRGM and choose the command 0: Goto and type in 1

: Goto 1




   
Another Goto command should now be inserted at the end of the next If Then statement. Scroll down to the Pause statement and move the cursor to the end of the line.
Press 2nd   INS and ENTER
Choose PRGM and choose the command 0: Goto and type in 1

: Goto 1




   
A matching label could now be assigned to the Goto statement using the command 9: Lbl

Scroll down to the end of the program and press enter to create a new line.
Choose PRGM and choose the command 9: Lbl and type in 1

: Lbl 1


Writing the Label

Enter the following lines remembering to obtain the control (CTL) and the input/output (I/O) commands by pressing PRGM in edit mode

When typing sentences use the alpha key lock
   
: ClrHome

: Disp ìCONTINUE ? ì

: Disp ìENTER 1 IF YESî

: Disp ìENTER 0 IF NOî

: If  I = 1  (For equal choose test)



   

: Then

: PrgmCOMPARE

: Else

: ClrHome

: End

: Stop


   
Execute the program by returning to the home screen. Press 2nd   Quit

Press PRGM

Choose EXEC and enter on COMPARE




 

[ TOP ] [ HOME ] [ SITE MAP ]
Copyright © Department of Education, Western Australia. All Rights Reserved.
updated January 2002