
« @ Local variable S is used
@ to store the step number.
@ Step from 1 to the size of the list.
FOR(S,l,SIZE(MARKS))
@ Extracts
the element from the
GET(MARKS,S) ^ E
@
Compares it to the pass mark,
@
replaces with the new
value.
« IF E>50 THEN
E+ " Pass"
►
E
ELSE
E+ " Fail"
►
E
END ;
REPL(MARKS,S, {E} ) ►MARKS
NEXT
Trapping errors
By default, a program halts when it encoimters an error. If you want
sections of your program to deal Avith errors rather than halt the program,
you need to include the sections inside error trapping structures. You can
then specify actions to take when your program encoimters errors, rather
than halting the program. The following error trapping structures are
available.
® IFERR code THEN error-code END
If the program encounters an error while it is nmning code, the remain
ing code is skipped and error-code is run. If no errors are encountered
in code, error-code is not rim.
® IFERR code THEN error-code ELSE noerror-code END
If the program encoimters an error while it is miming code, the remain
ing code is skipped and error-code is mn. If no errors are encountered
in code, noerror-code is nm.
Introduction to programming Page 10-15
Commentaires sur ces manuels