HP 39g hp 39g+ (39g & 40g)_mastering the hp 39g+_English_E_F2224-90010.pdf - Page 237
Graphics commands, Loop commands, FOR TO [STEP] END, DO UNTIL END, WHILE REPEAT END
View all HP 39g manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 237 highlights
The Graphics commands See the chapter "Programming the hp 39g+" on page 226 for examples illustrating some of the graphics commands used regularly. The Loop commands FOR = TO [STEP ] 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 UNTIL 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 REPEAT 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. 237