
E-118
Function
Executes another separate program (subroutine) from the current program
(main routine).
Subroutines
Main Routine
Level 1
Level 2
Level 3
Level 4
• 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.
Example Ans
→
A : Prog "SUB1" : Prog "SUB2"
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
(COMP)
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
^
Содержание fx-5800P
Страница 1: ...fx 5800P User s Guide http world casio com edu RJA516644 001V01 E ...
Страница 139: ...E 138 MEMO ...
Страница 140: ...E 139 MEMO ...
Страница 141: ...E 140 MEMO ...
Страница 142: ...E 141 MEMO ...
Страница 143: ...E 142 MEMO ...
Страница 144: ...E 143 MEMO ...
Страница 145: ...E 144 MEMO ...
Страница 146: ...CASIO Europe GmbH Bornbarch 10 22848 Norderstedt Germany This mark applies in EU countries only ...
Страница 147: ...CASIO COMPUTER CO LTD 6 2 Hon machi 1 chome Shibuya ku Tokyo 151 8543 Japan SA0606 A Printed in China ...