HP 39gs Master Manual page 278

Graphing calculator
Hide thumbs Also See for 39gs:
Table of Contents

Advertisement

Still referring to the code on the previous page, you will see that it refers to
. The sketches in the
PageNum
calculator's
view are numbered 1, 2, 3...etc. Sketch number 1 is always present but after that only
SKETCH
sketches that have been created are available and the program will crash if you try to access one that does
not exist.
The aplet variable
is the pointer to the sketch you want and the actual sketch page itself is called
PageNum
. Thus the two lines after
are telling the program to store the
view into the first page of the
Page
ELSE
PLOT
view using the command
. This command stores the
view into whatever graphics
SKETCH
PLOTÆ
PLOT
variable you specify. In this case into
.
Page
The
view must exist before this can be done or the program will crash. This is the reason for setting up
PLOT
the flag
discussed earlier – by doing that we ensure that this section of code only runs if something has
G
been plotted. If you run the program and then later change to the
view you will be able to see this
SKETCH
stored image. Finally, the user is presented with two messages which tell them what to do.
The next section contains the code which performs the work in the aplet by setting up a loop which repeats
until the user presses the
key to terminate.
ENTER
The first line before the loop begins assigns initial values to the variables
(the gradient) and
(the y-
M
C
intercept). The
loop which follows (partly in the next section of code) loops through the code
DO...UNTIL
within it until the
key is pressed.
ENTER
Within the loop, the previously stored
view is transferred from storage to the display using
SKETCH
. The
command means "transfer to the display screen". The equation of the current
DISPLAY
DISPLAY
line is then displayed in the top left corner using the
command which allows you to write text onto
DISPXY
the screen. Two versions are needed to avoid an expression like "y=2x+ -1" and write instead "y=2x-1".
278

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

40gs

Table of Contents