User`s manual
SAMPLE PROGRAM TO READ BLOCK 2 FROM TRACK 18: (stores contents
in B$)
10 OPEN 15,8,15
20 OPEN 5, 8,5,"#" ~
30PRINT# 15, "B.R:" 5,0, 18,2 ~
}
-B
B$
"" ~ ~ - LOCK
40= ~
50 FOR L=OTO 255
60 GET# 5, A$
70 IF ST=OTHEN B$= B$+A$: NEXT L
80 PRINT "FINISHED"
90 CLOSE 5: CLOSE 15
COLLECT ENTIRE BLOCK,
BYTE BY BYTE
BLOCK-WRITE
The BLOCK-WRITEcommand is the exact opposite of the BLOCK-READ
command. First you must fill up a data buffer with your information, then you
write that buffer to the correct location on the disk.
FORMAT FOR BLOCK-WRITE COMMAND:
PRINT# file#, "BLOCK-WRITE:" drive, channel, track, block
or abbreviated as
PRINT# file, "B-W:" drive, channel, track, block
When the data is being put into the buffer, a pointer in the DOS keeps
track of how many characters there are. Whenyou perform the BLOCK-WRITE
operation, that pointer is recorded on the disk. That is the reason for the ST
check in line 70 of the program above: the ST will become non-zero when you
try to read past the end-of-file marker within thr record.
SAMPLE PROGRAM TO WRITE DATA ON TRACK 1, SECTOR I:
10 OPEN 15,8, IS
20 OPEN 5, 8, 5, "#"
30FOR L=I to 50
40 PRINT#5, "TEST"
50 NEXT
60 PRINT# 15, "B-W:" 5,0, I, I
70 CLOSE 5: CLOSE 15
28