Example - HP 49g User Manual

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

Advertisement

Example

«
@ Set numeric mode so that error trap works
SF(-3) ;
@ Create an empty list
{} MARKS ;
@ Set up a loop for 20 entries.
WHILE SIZE(MARKS)<20 REPEAT
@ Start error-checking routine.
IFERR INPUT("Enter a number","")
@ Attempt to convert the entry to a number.
@ This generates an error if non-numeric
« OBJ (N)+1-1
@ If no error, append the entry to the list.
« MARKS+N
»
»
THEN
@This appears if entry is non-numeric.
MSGBOX("INVALID ENTRY, TRY AGAIN")
END ;
END
»
Page 10-16
N
MARKS
N
Introduction to programming

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents