HP 39GS hp 39gs_user's guide_English_E_HDPMG39AE13.pdf - Page 245
Loop commands, ZEROGROB
UPC - 808736931328
View all HP 39GS manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 245 highlights
ZEROGROB Creates a blank graphic with given width and height, and stores it in graphicname. ZEROGROB graphicname;width;height: Loop commands Loop hp allow a program to execute a routine repeatedly. The HP 39gs has three loop structures. The example programs below illustrate each of these structures incrementing the variable A from 1 to 12. DO...UNTIL ...END Do ... Until ... End is a loop command that executes the loop-clause repeatedly until test-clause returns a true (nonzero) result. Because the test is executed after the loop-clause, the loop-clause is always executed at least once. Its syntax is: WHILE... REPEAT... END FOR...TO...STEP ...END Programming DO loop-clause UNTIL test-clause END 1 A: DO A+1 A DISP 3;A: UNTIL A == 12 END: While ... Repeat ... End is a loop command that repeatedly evaluates test-clause and executes loop-clause sequence if the test is true. Because the test-clause is executed before the loop-clause, the loop-clause is not executed if the test is initially false. Its syntax is: WHILE test-clause REPEAT loop-clause END 1 A: WHILE A < 12 REPEAT A+1 A DISP 3;A: END: FOR name=start-expression TO end-expression [STEP increment]; loop-clause END FOR A=1 TO 12 STEP 1; DISP 3;A: END: 18-23