Casio fx-5800P User Manual page 119

Casio calculator user's guide fx-5800p
Hide thumbs Also See for fx-5800P:
Table of Contents

Advertisement

Function
Executes another separate program (subroutine) from the current program
(main routine).
Main Routine
• A subroutine can be called up as many times as you like from the main
routine. A subroutine can be called up from any number of main routines.
• Execution of the Prog "fi le name" command jumps to the subroutine and
runs it from the beginning. When the end of the subroutine is reached,
processing jumps back to the main routine and continues from the
statement following the Prog "fi le name" command.
• You can use the Prog command inside of a subroutine to cause process
to jump to another subroutine. This is called "nesting". You can nest
subroutines up to 10 levels. Attempting to nest more than 10 levels causes
an error (Ne ERROR).
• Note that a Goto ~ Lbl jump within a subroutine can be performed only
within the same subroutine.
• An error (Go ERROR) will occur if the program specifi ed by the Prog "fi le
name" command cannot be found for some reason.
Important!
• A program that uses Formula as the run mode cannot be used as a
subroutine.
• The main routine and the subroutine must be the same run mode. This
means, for example, that a subroutine that is a program whose run mode
is BASE-N cannot be called by a main routine that is a program whose run
mode is COMP.
Ans → A : Prog "SUB1" : Prog "SUB2"
Example
Note
For information about using the Prog command outside of the PROG Mode,
see "Using the Prog Command to Run a Program" (page 110).
A Program Control Commands
Break
Syntax
... : Break : ...
Function
This command forces a break in a For, While, or Do loop, and jumps to the
next command. Normally, this command is used inside of a Then statement
in order to apply a Break condition.
Example
While A > 0 : If A > 2 : Then Break : IfEnd : WhileEnd : A
Subroutines
Level 1
Level 2
E-118
Level 3
Level 4
(COMP)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents