110 PROC myproc()
120 PRINT "Pigs:";pigs
130 RETURN
200 DEFPROC myproc()
210 LOCAL m
220 ON ERROR PRINT "Myproc
died...":ENDPROC
230 PRINT "m=";m,"n=";n
240 ENDPROC
Note that any LOCAL commands in a procedure or subroutine must come before a local error handler (ie lines 210 and 220 in the example cannot be reversed).
ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.