[Coco] Updating RSDOS text files with DISK BASIC ver, 2,1

coco at jechar.ca coco at jechar.ca
Mon Dec 19 10:18:59 EST 2022


All

Updating RSDOS text file.
The manual says that the syntax for OPEN is

OPEN m,#dev,f

And that m has values of "I" - input or "O" - output

There does not seem to be a U for update unless m can be "IO"

So I assume that for Basic you must
    0. open file.TXT for input.
    1. Read the entire file into an array.
    2. Close the file.TXT and then Copy the original file to file.OLD
    3. delete the original file.TXT
    4. process the array
    5. Open file.TXT for output
      ( Am assuming this automatically creates empty file called file.TXT 
)
    6. Save the contents of the array into file.TXT
    7. Close
    8. exit

If anyone knows of an more efficient and less limiting approach that can 
be taken in disk basic I would appreciate your suggestions.

Thanks.

Charlie


More information about the Coco mailing list