5 ON ERROR GOTO 1000
10 OPEN "test.dat"FOR RANDOM LOCK READ AS 1
20 GET#1, 1
30 PUT#1, 1
40 LOCK#1, 1
50 OPEN "test.dat"FOR RANDOM AS 2
60 OPEN "test.dat"FOR RANDOM ACCESS READ AS 2
70 OPEN "test.dat"FOR RANDOM ACCESS WRITE AS 2
80 OPEN "test.dat"FOR RANDOM ACCESS READ WRITE AS 2
90 UNLOCK#1, 1
150 OPEN "test.dat"FOR RANDOM AS 2
160 OPEN "test.dat"FOR RANDOM ACCESS READ AS 2
170 OPEN "test.dat"FOR RANDOM ACCESS WRITE AS 2
180 OPEN "test.dat"FOR RANDOM ACCESS READ WRITE AS 2
190 CLOSE
210 OPEN "test.dat" FOR RANDOM ACCESS WRITE LOCK READ AS 1
220 GET#1, 1
230 PUT#1, 1
240 LOCK#1, 1
250 OPEN "test.dat"FOR RANDOM AS 2
260 OPEN "test.dat"FOR RANDOM ACCESS READ AS 2
270 OPEN "test.dat"FOR RANDOM ACCESS WRITE AS 2
280 OPEN "test.dat"FOR RANDOM ACCESS READ WRITE AS 2
290 UNLOCK#1, 1
350 OPEN "test.dat"FOR RANDOM AS 2
360 OPEN "test.dat"FOR RANDOM ACCESS READ AS 2
370 OPEN "test.dat"FOR RANDOM ACCESS WRITE AS 2
380 OPEN "test.dat"FOR RANDOM ACCESS READ WRITE AS 2
390 CLOSE
999 END
1000 OPEN "errors.txt" FOR APPEND AS 3
1005 PRINT#3, ERR, ERL
1007 CLOSE 3
1010 RESUME NEXT
