HP 33s Owner's Manual page 193

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

Advertisement

Using Flags
º ·
Pressing
After selecting the function you want, you will be prompted for the flag number
(0–11). For example, press
Ë
{  }
to set flag 10; press
Menu Key
{  } n
{  } n
{  } n
A flag test is a conditional test that affects program execution just as the
comparison tests do. The FS ? n instruction tests whether the given flag is set. If it is,
then the next line in the program is executed. If it is not, then the next line is
skipped. This is the "Do if True" rule, illustrated under "Conditional Instructions"
earlier in this chapter.
If you test a flag from the keyboard, the calculator will display "  " or "  ".
It is good practice in a program to make sure that any conditions you will be
testing start out in a known state. Current flag settings depend on how they have
been left by earlier programs that have been run. You should not assume that any
given flag is clear, for instance, and that it will be set only if something in the
program sets it. You should make sure of this by clearing the flag before the
condition arises that might set it. See the example below.
Example:
Using Flags.
The "Curve Fitting" program in chapter 16 uses flags 0 and 1 to determine
whether to take the natural logarithm of the X– and Y–inputs:
Lines S0003 and S0004 clear both of these flags so that lines W0007 and
W0011 (in the input loop routine) do not take the natural logarithms of the
X– and Y–inputs for a Straight–line model curve.
Line L0003 sets flag 0 so that line W0007 takes the natural log of the
X–input for a Logarithmic–model curve.
File name 33s-E-Manual-1008-Publication(1st).doc
Printed Date : 2003/10/8
displays the FLAGS menu: {  } {  } {  }
º ·
{  } 0 to set flag 0; press
º ·
{  }
FLAGS Menu
Description
Set flag. Set flag n.
Clear flag. Clears flag n.
Is flag set ? Tests the status of flag n.
Programming Techniques
Page : 386
Size : 13.7 x 21.2 cm
º ·
Ë
1 to set flag 11.
13–11

Advertisement

Table of Contents
loading

Table of Contents