[Coco] quick basic09 copy program

L. Curtis Boyle curtisboyle at sasktel.net
Mon Feb 4 08:33:57 EST 2008


On Sun, 03 Feb 2008 03:38:41 -0600, Willard Goosey <goosey at virgo.sdc.org>  
wrote:

> On Sat, Feb 02, 2008 at 08:47:03PM -0600, L. Curtis Boyle wrote:
>
>> A larger buffer (with larger read/writes) will run a bit faster than
>> a smaller buffer, but you can hard code it for whatever size you want
>
> Is that proper BASIC-09 style?  This would be like:
> PROCEDURE filecopy
> PARAM oldfile, newfile...
> ....
> DIM buffer[2000] ....
>
> (or something like that, I can't do actual correct BASIC-09 off the
> top of my head)
>
> Or would it be more useful as a general-purpose subroutine, to be
> like:
> PROCEDURE filecopy
> PARAM oldfile, newfile, buffer
> .....
>
> The first one you'd just  RUN filecopy("/dd/foo", "./bar")
> The second would be :
> DIM buff[2000]
> ....
> RUN filecopy("/dd/foo","./bar",buff)
>
> The second way, when you add a MultiVue interface to your program, you
> can shrink the buffer the subroutine uses, even if you don't have the
> source for it.
>
> Willard

It's been awhile... I can't remember how easy it is to change the buffer  
size within a BASIC09 program itself (I think you have to jump through  
some hoops, as you can't dynamically redefine a variable to a different  
size), so the hard-coded version would definitely be easier to code (and  
recompile if you did decide to change the buffer size later). Multivue  
itself won't take extra room from your program (although it will take some  
extra from the entire computer as a whole); it gets it's own 64K workspace  
with GRFDRV apart from RUNB and it's workspace. You would need some extra  
coding and variables in your BASIC09 program to create the menus and the  
like for MultiVue, but using it by itself does not require all that much  
extra.

-- 
L. Curtis Boyle



More information about the Coco mailing list