10 REM PC-BASIC test 
20 REM ON PEN syntax
30 OPEN "OUTPUT.TXT" FOR OUTPUT AS 1
40 ON ERROR GOTO 1000
42 ON PEN("") GOSUB 500
44 ON PEN GOSUB 500
45 ON PEN(-1) GOSUB 500
46 ON PEN(3) GOSUB 500
47 ON PEN(0) GOSUB 500
48 ON PEN(256) GOSUB 500
49 ON PEN(32768) GOSUB 500
400 END
500 RETURN
1000 PRINT#1, ERR, ERL
1010 RESUME NEXT
