[Coco] RANDOM ACCESS FILES IN DISK BASIC

Christopher R. Hawks chawks at dls.net
Mon Jan 23 21:24:09 EST 2023


On Mon, 23 Jan 2023 20:21:25 -0500
coco--- via Coco <coco at maltedmedia.com> wrote:

> 
> Hi Trying to figure out how to open a random access file in disk
> basic.
> 
> Tried this code
> 
> 10 DIR 0
> 11 PRINT "FILE NAME"
> 12 INPUT F$
> 14 F$=F$+":0"
> 16 PRINT F$
> 20 OPEN "D",X,F$,1
> 
> The idea is that the program would be ran from disk 1 but would use
> data files on disk 0.
> 
> This program gives me an error, the file name was TEST it is a binary
> file I want to grab each byte and then display the hex value should be
> easy enough but I get an error in line 20.
> 
> What have I done wrong ?
> 
> Charlie
> 

Charlie:

    First thing that jumps out is too many params to 'OPEN'. Should
only be 2 after the "D". Buffer number (#1) and name ($F).

    See page 34 in the "Color Computer Disk System" manual.
https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color
Computer Disk System (Tandy).pdf


Christopher R. Hawks
HAWKSoft
-- 
On a repair shop door:
WE CAN REPAIR ANYTHING.
(PLEASE KNOCK HARD ON THE DOOR THE BELL DOESN'T WORK.)
Proofreading is a dying art, wouldn't you say?
----------------------------------------
       \   ^__^                         
        \  (oo)\_______                 
           (__)\       )\/\           
               ||----w |                
               ||     ||                


More information about the Coco mailing list