The Graphics Commands; The Loop Commands; For <Var> = <Start> To <End> [Step] <Statements> End; Do Until - HP 39g Master Manual

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

Advertisement

T
h
e
G
r
a
p
h
i
c
s
c
T
h
e
G
r
a
p
h
i
c
s
c
See the chapter "Programming the hp 39g+" on page 226 for examples
illustrating some of the graphics commands used regularly.
T
h
e
L
o
o
p
c
o
m
m
T
h
e
L
o
o
p
c
o
m
m
FOR <variable> = <start value> TO
<end value> [STEP <increment>] <statements> END
This is a standard FOR...NEXT command.
The STEP value is optional and is assumed to
be 1 if not stated. Whatever you do, don't use
NEXT to terminate the loop! It doesn't register
as an error but all sort of strange things
happen!
DO <statements> UNTIL <test clause> END
This loop executes the statements within it
until the test clause evaluates as true. It must
execute at least once. The example right
checks for a positive integer from the INPUT
statement. To be even more user friendly you
could let the user know what they had done wrong by adding another few
lines of code within the DO loop of..
IF INT(N) N OR N 0 THEN
MSGBOX "Enter a positive integer only":
END:
WHILE <test clause> REPEAT <statements> END
This is similar to the DO...UNTIL loop except that the test clause is evaluated
before starting so that the loop may not be executed at all.
o
m
m
a
n
d
s
o
m
m
a
n
d
s
a
n
d
s
a
n
d
s
237

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

40g39g+

Table of Contents