[Coco] OS9 Programming question
Bill Pierce
ooogalapasooo at aol.com
Fri Jan 18 22:02:58 EST 2013
The wait(0) cmd makes the calling program wait for the forked process to terminate before resuming operation (any or no signal). Any other value other than 0 will wait for a signal of that number before resuming. I would use wait(2) for the break signal, but if the forked program runs till it finishes, it doesn't produce a signal. So the wait(0) covers all.
It seems that the break key is being stored in the input buffer of the stdin and echoed once the first screen write is performed by the main program. I could try doing a write before leaving the forked process to empty the buffer before exiting. I've tried fflush, but I've noticed in everything I've been working on lately that fflush does not seem to work at all in anything.
I don't think sleep would work even though I could send a wake signal on return, the break key would still be in the buffer.
Bill P
Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Bill Pierce
ooogalapasooo at aol.com
-----Original Message-----
From: Robert Gault <robert.gault at att.net>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Fri, Jan 18, 2013 9:44 pm
Subject: Re: [Coco] OS9 Programming question
Bill Pierce wrote:
>
> Actually, I think I answered my problem by reading my own question (as usual).
I noted in the previous response to Robert Gault that the signals were being
sent to the keyin routine and being processed as a key read. As a temporary fix
until I figure out why the chars are being sent to start with, I've added a
filter to my input routine to filter any character below chr$(8) as the
characters seem to be between 1-4 anyway. This way the arrow keys will still
come through and it seems to have solved the problem.
> This is only a temp fix. The real problem needs to be resolved in the player
programs where the chars are being generated.
>
> Bill P
>
Could be.
What does wait do when it receives data from the child process?
for(sngnum = 0; sngnum <= numsng; sngnum++) {
fname = selection[sngnum];
args = parms[sngnum];
os9fork(fname,len,args,1,1,80);
wait(0);
}
How would the substitution of sleep for wait work with your code?
--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list