Files
gw-basic-2026/tests/programs/random_access.bas
Eremey Valetov df5c3083b1 Add README, implement KILL/NAME, use relative paths in tests
Add README.md for public release. Implement KILL and NAME statements
for file management. Change test programs to use relative paths
instead of /tmp/ and clean up temp files with KILL. Update .gitignore
for test artifacts.
2026-02-10 15:53:57 -05:00

18 lines
434 B
QBasic

10 REM Random-access file I/O test
20 OPEN "R", #1, "gwbasic_random.dat", 32
30 FIELD #1, 20 AS N$, 4 AS A$, 8 AS S$
40 LSET N$ = "Alice"
50 LSET A$ = MKI$(25) + " "
60 LSET S$ = MKD$(50000.5)
70 PUT #1, 1
80 LSET N$ = "Bob"
90 LSET A$ = MKI$(30) + " "
100 LSET S$ = MKD$(75000.25)
110 PUT #1, 2
120 GET #1, 1
130 PRINT LEFT$(N$, 5); CVI(A$);
140 GET #1, 2
150 PRINT LEFT$(N$, 3); CVI(A$)
160 CLOSE #1
170 KILL "gwbasic_random.dat"