Nested Subroutines - HP 33s Owner's Manual

Rpn/alg scientific calculator
Hide thumbs Also See for 33s:
Table of Contents

Advertisement

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
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.
File name 33s-E-Manual-1008-Publication(1st).doc
Printed Date : 2003/10/8
+
+
+
a
b
c
2
2
2
Programming Techniques
Page : 386
Size : 13.7 x 21.2 cm
d
2
13–3

Advertisement

Table of Contents
loading

Table of Contents