printf, data presentation

Peter da Silva peter at ficc.uu.net
Sat Jan 7 08:25:11 AEST 1989


>From my recollection of BASIC, INKEY$ has two main uses:

	(1) Enabling a clean abort of a running compute-bound
	    program.

	(2) Busy-waiting for a time-interval.

For case 1, UNIX provides signal handlers. For case 2, a read-with-timeout
is more useful. Luckily, UNIX provides this as well. For long timeouts, it
reduces to the case of a signal handler. For short timeouts, you need the
USG termio, and set VMIN and VTIME.

	(3) Terminal emulators.

For this case, you're better off with a multiway wait or two cooperating
processes.

Using an inkey$ type call to do this will just get you a bad name as a system
hog. We just had to rip code like this out of microEmacs last year some
time.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Work: uunet.uu.net!ficc!peter, peter at ficc.uu.net, +1 713 274 5180.   `-_-'
Home: bigtex!texbell!sugar!peter, peter at sugar.uu.net.                 'U`
Opinions may not represent the policies of FICC or the Xenix Support group.



More information about the Comp.lang.c mailing list