Property | Value |
---|---|
Hex Value | $D5 |
Categories | |
Localizations |
|
Return
Overview
Returns to the calling program.
Availability: Token only available from within the Basic editor.
Syntax
Return
Location
prgm, CTL
, E:Return
Description
When the Return command is used in a program it exits the program (terminating the program execution) and returns the user to the home screen. If it is encountered within loops, the loops will be stopped.
There is some distinction when using Return with subprograms: the Return command will stop the program execution of the subprogram, and program execution will go back to the calling program, continuing right after the subprogram call. If this functionality is not desired, then you should use the Stop command instead. Generally, though, you should use Return instead of Stop.
:ClrHome
:Input "Guess:",A
:Stop
Replace Stop with Return
:ClrHome
:Input "Guess:",A
:Return
Optimization
You don't have to put a Return command at the end of a program or subprogram if you can organize the program so that it just naturally quits. When the calculator reaches the end of a program, it will automatically stop executing as if it had encountered a Return command (the Return is implied).
:ClrHome
:Input "Guess:",A
:Return
Remove the Return
:ClrHome
:Input "Guess:",A
Error Conditions
- ERR:INVALID occurs if this statement is used outside a program.
Related Commands
See Also
Source: parts of this page were written by the following TI|BD contributors: burr, DarkerLine, GoVegan.
History
Calculator | OS Version | Description |
---|---|---|
TI-82 | 1.0 | Added |