[Coco] multiple windows on a screen in Basic09

Tim Fadden t.fadden at cox.net
Thu Jan 14 17:47:27 EST 2010


On 1/14/2010 2:53 PM, Bob Devries wrote:
> Hi all,
>
> I have been trying to emulate what Wayne Campbell is trying to do, 
> that is, to have two active windows on a single screen using Basic09.
>
> Now I know that this is possible, since there was an example shell 
> script on the original OS9 System disk called "window.glr4". This 
> script produced three active windows on a graphics screen, and opened 
> a shell in two of them.
>
> I'm trying to emulate this in Basic09, but so far, no luck.
>
> Here's what I have:
>
> PROCEDURE twowin
> DIM x:INTEGER
> DIM a$:STRING[80]
> DIM wpath1,wpath2:BYTE
> OPEN #wpath1,"/w1":UPDATE
> OPEN #wpath2,"/w1":UPDATE
> RUN gfx2(wpath1,"DWSet",2,0,0,80,20,0,1,1)
> RUN gfx2(wpath2,"DWSet",0,0,21,80,4,2,3)
> RUN gfx2(wpath1,"Select")
> PRINT #wpath1,"Output window"
> RUN gfx2(wpath2,"Select")
> PRINT #wpath2,"Input window"
> INPUT #wpath2,"Type a line",a$
> RUN gfx2(wpath1,"Select")
> PRINT #wpath1,a$
> RUN gfx2(wpath2,"Select")
> RUN gfx2(wpath2,"CurXY",0,0)
> RUN gfx2(wpath2,"Clear")
> FOR x=1 TO 10000
> NEXT x
> RUN gfx2(wpath2,"DWEnd")
> RUN gfx2(wpath1,"DWEnd")
> CLOSE #wpath2
> CLOSE #wpath1
> END
>
> The code when run, gives an error 184, "Window already defined". I 
> have also tried 255 as the first parameter (window type), to no avail.
>
> According to the Basic09 manual, the use of 0 and 255 are special case 
> window types, "0" specifies the current screen, and 255 "Current 
> display screen. Use when putting several windows on the same physical 
> screen" (Basic09 Reference, page 9-34)
>
> Has anyone else ever tried this? Since it's possible using a shell 
> script, in my view it _should_ be possible using Basic09.
>
> Regards, Bob Devries
>
> -- 
> Besides a mathematical inclination, an exceptionally good mastery of 
> one's native tongue is the most vital asset of a competent programmer.
>
> Edsger W.Dijkstra, 18 June 1975
>
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
>
I think each window must have its own unique number. IE: /w1 /w2 /w3 /w4 
etc. Looks like you are defining /w1 twice.

Tim



More information about the Coco mailing list