The final check in the line
UNTIL K==105.1 END:
is to see if the user has pressed the
ENTER
key. If so then
the loop will terminate and the screen will erase. If not then the loop begins again with the new line being
displayed. On termination of the program the
VIEWS
menu will display again, because we chose this when
designing the aplet in the ADK.
This aplet illustrates most of the commonly used programming techniques. If you would like to gain
experience then I suggest that you do as I did when I first began programming the HP - download aplets and
pull them apart to see how they work.
If you would like to further enhance this aplet then try the following:
•
change the order of the code so that the labels are drawn after the line, thus ensuring that the text is
never obscured by the line.
•
add a new variable
D
to allow the size of the increment to change. Set an initial value of
D
of 0.5 at
the same point as the values of
M
and
C
. Then change the lines in the
CASE
stataement so that
D
is
added/subtracted instead of 0.5. Add two more
IF
s to the
CASE
statement so that if they press ‘+’
the increment doubles, and if ‘-’ then it halves. You will also need to add another message box line
telling them about this. Finally, add a line to display the current increment size at the top right of the
screen using the
DISPXY
command. Be careful that your display does not go off the screen.
The explanation so far should help you in understanding the programming process on the hp 39gs & hp
40gs. The aplet structure is well designed and, if you take advantage of the
VIEWS
menu structure, offers
easy creation of complex and very powerful teaching aplets. Certainly what has been discussed here is
enough that a programmer will be able to make a start without some of the errors that I made.
280