File: TEST.BAS

package info (click to toggle)
pcbasic 2.0.7-8
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 35,416 kB
  • sloc: python: 28,411; sh: 103; makefile: 10
file content (28 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
10 REM PC-BASIC test 
20 REM LOCK and UNLOCK
25 REM model built with MS-DOS 5 & GW-BASIC 3.23 on VirtualBox
30 open "errors.txt" for output as 2
35 on error goto 10000
40 open "test.dat" for output as 1
50 lock#1, 1 to 3
60 print#1, "test"
70 open "test.dat" for random as 3
80 get#3, 2
90 put#3, 4
95 put#3, 2
100 lock#3, 1 to 3
110 get#3, 2
120 put#3, 2
130 unlock#1, 1 to 2
140 unlock#1, 1 to 3
150 print#1, "test2"
160 put#3, 3
170 rem in gw-basic, which write prevails depends on close sequencing
175 rem whichever file gets their buffer flushed last prevails
177 rem not whoever performed the last operation
180 rem let's not test that here - enforce flushing PRINT before PUT
190 close 1: close 3
999 end
10000 print#2, err, erl
10010 resume next