10 REM PC-BASIC test 
20 REM LOCK and UNLOCK syntax
30 OPEN "OUTPUT.TXT" FOR OUTPUT AS 3
40 ON ERROR GOTO 10000
50 OPEN "ONE" FOR RANDOM AS 1
60 LOCK 1
70 UNLOCK 1
80 LOCK#1
90 UNLOCK#1
100 LOCK 1: LOCK 1
110 LOCK#1, 1
120 LOCK#1, 2 TO 6
130 UNLOCK#1, 1
140 UNLOCK#1, 2 TO 6
150 LOCK#1, 1: LOCK#1, 2 TO 6
160 UNLOCK#1, 1 TO 6
170 LOCK#1,
180 LOCK#1 LPRINT
190 LOCK#1, LPRINT
200 LOCK#1, 1 TO 2 TO 3
210 CLOSE#1
2050 OPEN "ONE" FOR OUTPUT AS 1
2060 LOCK 1
2070 UNLOCK 1
2080 LOCK#1
2090 UNLOCK#1
2100 LOCK 1: LOCK 1
2110 LOCK#1, 1
2120 LOCK#1, 2 TO 6
2130 UNLOCK#1, 1
2140 UNLOCK#1, 2 TO 6
2150 LOCK#1, 1: LOCK#1, 2 TO 6
2160 UNLOCK#1, 1 TO 6
2170 LOCK#1,
2180 LOCK#1 LPRINT
2190 LOCK#1, LPRINT
2200 LOCK#1, 1 TO 2 TO 3
2210 CLOSE#1
9999 END
10000 PRINT#3, ERR, ERL
10010 RESUME NEXT

