[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Sep 26 00:59:13 1994 
Subject:Re: Pause 
From:Adrian John Howard 
Volume-ID:940927.02 

[Aaron wrote]
>
> yan@uk.ac.keele.cs ("M. Sapiyan") writes:
> > Date: 15 Sep 1994 11:46:07 +0100
> >
[SNIP]
> >   In Pop11, is it possible to pause from whatever the program is doing, by
> >   pressing a key, say space bar, and pressing the same key for the
> >   second time, lets the program resume its process.
[SNIP]
> Another possibility is to redefine the interrupt handler in your
> program, and then use CTRL-c to interrupt and pause, until
> you type another character.
[SNIP]
> Another way to handle this is to "poll" from time to time, to see
> whether there is any input waiting on the terminal, and if so to
> read a character and pause until another character is typed.
[SNIP]
>I hope this all makes sense. There may be more elegant methods.
>For example you could use sys_timer to set up a procedure to check
>every N seconds whether something has been typed at the keyboard and
>if so to set a flag that makes the current program pause.

It should be pointed out that neither of the methods Aaron gives will
"pause" any asychronous timers. (From a previous conversation I can
guess that Sapiyan may well be using timers).

To pause the timers you would have to dlocal either pop_asts_enabled or
pop_enable_interrupts (depending on your version of Poplog). See
REF * ASYNC for more details.

Adrian

aids (adrianh@cogs.susx.ac.uk)  ObDisclamer: Poplog used to pay my wages
Phone: +44 (0)273 678367  URL: http://www.cogs.susx.ac.uk/users/adrianh/