drack@titan.tsd.arlut.utexas.edu (Dave Rackley) (11/16/90)
I need to have single-character input via VAXC v3.0 on VMS v5.3. Guidance would be helpful, C-source would be greatly appreciated! I know this is an age-old problem, so there must be an age-old solution. From what I can tell SYS$QIOW is the system service that needs to be used, but I have only experienced stack dumps when executing the code. Thanks in advance. -- DISCLAIMER? I don't know anything 'bout any ol' disclaimer! +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+ | David Rackley | | | Applied Research Laboratories | Remember, you can tuna fish, | | The University of Texas | But you can't tuna piano! | | Austin, TX. 78758 | | +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
lane@elwood.enet.dec.com (11/17/90)
#include iodef
#include stdio
#include ssdef
#include descrip
main()
{
char buffer[80],*p1 = &buffer;
int status_block[2],status,channel,p2 = 1;
$DESCRIPTOR (terminal,"SYS$COMMAND");
status = sys$assign (&terminal,&channel,0,0);
if (status != SS$_NORMAL)
exit (status);
printf("\nInput: ");
status = sys$qiow (1,channel,IO$_READVBLK,&status_block,0,0,p1,p2,0,0,0,0);
if (status != SS$_NORMAL)
exit (status);
buffer[1] = '\0';
printf ("\nChar is %s\n",p1);
exit (1);
}