EasyManuals Logo

HP 39gs Master Guide

HP 39gs
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #277 background imageLoading...
Page #277 background image
The second and third lines insert a function into F1(X). This can only be
done, of course, if the parent aplet is
Function. If you do this when the
parent is another aplet then the code will still execute but the function
will be inserted into the real
Function aplet!
The reason for inserting this particular function is that we need a function when the axes are plotted or the
normal error message will be displayed (see above right). This is undesirable because it will confuse the user.
On the other hand we need blank axes for later use in exploring, so we use a trick – we set the function being
inserted to be ‘Ymax+1’. This is a constant linear function, a horizontal line, which is guaranteed to be
off-screen for the entire domain no matter what axes are used vertically. Clever, eh?
The next program code we will look at belongs to the 1
st
option on the VIEWS menu of ‘Plot axes’.
A message is first given to the user of how to proceed if they want to use different axes. The flag value of
G is
then set to 1 so that the next program can tell that the axes are ready to use. The function is also re-entered in
case the user has changed the
SYMB view. Users have an annoying habit of changing things so try to allow
for this in your programs by making them fool-proof.
The next program below runs when the user chooses the second menu option of “Explore”, and illustrates a
very important technique. A copy of the
PLOT view is stored in the aplet’s sketch view and then retrieved
and modified using the various graphics commands. The program is broken into parts for discussion purposes.
The reason for the “
IF G==0 THEN” is to check that the blank axes have been plotted and are available for
use. If not then the user receives a message to tell them what to do and the remainder of the program is
bypassed using the
IF…THEN…ELSE statement. Trying to capture a PLOT view that doesn’t exist is a major
error and will result in the program crashing abruptly. It is possible to allow for errors like this using the
IFERR statement but in a teaching example like this it makes the code more difficult to follow.
277

Table of Contents

Other manuals for HP 39gs

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 39gs and is the answer not in the manual?

HP 39gs Specifications

General IconGeneral
TypeScientific
Form factorPocket
Product colorGray
Internal memory0.256 MB
Weight and Dimensions IconWeight and Dimensions
Weight249 g
Dimensions (WxDxH)187 x 94 x 31 mm

Related product manuals