[Coco] noob question

Salvador Garcia salvadorgarciav at yahoo.com
Wed Nov 8 11:53:08 EST 2017


 Regarding the event driven model.

Event driven s/w is made possible because there is support for it in the underlying operating system Linux, OS/X, Windows). It goes beyond the language that you are using, for example, C#, because the OS is built around this model.

Back in he early 90s I was curious how an event driven model could be implemented using MS-DOS and its bundled language GW-BASIC, so I set up a simple "form".

MS-DOS itself runs using a glorified loop where it polls the KB buffer to determine whether the user has entered anything. Although we see the text cursor sitting there besides the prompt, the OS is not waiting for us to hi the Enter key. It is always doing something.  I decided to piggyback on top of this by using INKEY$ to "poll" the KB buffer within my concept app. I found that I needed to add lots of admin code to keep track of what the user had entered, and how to react depending on the keystroke and location. At that time, the event driven model was taking off and seen as the future of s/w development.

I liked William's post using Daggorath as an example. This is a classic case of the developer implementing the underlying support mechanism to run on top of the CoCo hardware (I don't know if any of the ROM s/w is used) to achieve a rudimentary event driven model.

Using a glorified loop, polling, and IRQs (wisely) I believe that such a model can be reproduced with the CoCo, but be prepared to create the necessary layer that allows this, plus the communication chain between the app and the support system (API). The CoCo has all the right pieces, it just needs the glue :-).

Salvador



    On Tuesday, November 7, 2017, 3:23:43 PM CST, Randy Weaver <emceesquared at gmail.com> wrote:  
 
 I'm used to coding in c#... an event driven language.

 

Actions are hooked to events that "raise" a function I wrote to do
something.

 

I'm trying to wrap my head around how you would achieve similar behavior on
a coco.

 

I suppose a loop that kept polling for statuses that I'm interested in.

 

IRQs are interesting too but do they fire 60 times a second?  And what
happens when my check doesn't complete in 1/60th of a second. does it fire
again?

 

Guess I'm trying to get the basics here.

 

Thanks!

Randy


-- 
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco
  


More information about the Coco mailing list