HP 33s hp 33s_user's manual_English_E_HDPM20PIE56.pdf - Page 187
Nested Subroutines, MAIN program, top level, End of program
UPC - 082916001456
View all HP 33s manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 187 highlights
Nested Subroutines A subroutine can call another subroutine, and that subroutine can call yet another subroutine. This "nesting" of subroutines - the calling of a subroutine within another subroutine - is limited to a stack of subroutines seven levels deep (not counting the topmost program level). The operation of nested subroutines is as shown below: MAIN program (top level) End of program Attempting to execute a subroutine nested more than seven levels deep causes an error. Example: A Nested Subroutine. The following subroutine, labeled S, calculates the value of the expression a2 + b2 + c2 + d2 as part of a larger calculation in a larger program. The subroutine calls upon another subroutine (a nested subroutine), labeled Q, to do the repetitive squaring and addition. This saves memory by keeping the program shorter than it would be without the subroutine. Programming Techniques 13-3