VAX-C immediate char reading
Jack Rusher
corwin at sparky.cis.ufl.edu
Sat Dec 15 11:18:49 AEST 1990
The best way to perform the sort of I/O you have mentioned is to
set up an $QIO call that specifies an AST handler to call when your
routine gets input.
As Per (excuse my pseudo-code):
volatile char Ch;
ProcessChar()
{
DoStuff(Ch);
$QIO (IO$READVBLK, Channel, etc, Ch, etc, ProcessChar, etc);
}
main()
{
$QIO (IO$READVBLK, Channel, etc, Ch, etc, ProcessChar, etc);
while (!done)
do_non_player_stuff();
}
Which will call "ProcessChar" when there is stuff to input, and
will continue to execute in the meantime. Check out the docs for
$QIO, $ASSIGN and the other stuff in the System Services section of
the VMSHELP files for more information on exact syntax.
If you do not grok what it has to say, do not dispair! There will
soon be another solution to your problem. The GameLib project here
at UF is producing an object library for just this sort of thing.
-Jack Rusher,
corwin at ufl.edu
More information about the Comp.lang.c
mailing list