Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!decvax!ucbvax!LOYVAX.BITNET!JSOTTILE From: JSOTTILE@LOYVAX.BITNET Newsgroups: comp.os.vms Subject: An Inkey Function for DCL Message-ID: <8801041952.AA01586@ucbvax.Berkeley.EDU> Date: 4 Jan 88 16:07:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 186 I have been reading a few people's questions about an 'inkey' type function for DCL. Well, here it is. It is too slow, but it's not too fast either. Please excuse the poor programming in it, it was done when I first learned C. I'd appreciate comments and/or suggestions (constructive criticism, please). I assume no responsibility for the performance of this program (and neither does my employer). If it has bugs on your system, send me mail or try to fix it (tell me what you did to fix it too). - John Sottile Student Systems Programmer (JSOTTILE@LOYVAX.BITNET) Loyola College in Maryland (FidoNet Address : 261/659) The ideas expressed here are [...]*.*;* /********************* Cut Here *********************************************/ /****************************************************************************/ /* */ /* Programmer: John Sottile */ /* */ /* Date: October 29, 1985 */ /* */ /* Description: This program adds an addition command to the DCL */ /* library. The call will allow a single character read */ /* from the keyboard to go into a local DCL variable. */ /* */ /* The call is as follows: */ /* */ /* $ getkey variable_list */ /* */ /* The Variable List can be a multiple list of variables, */ /* but they must be separated by a space. */ /* */ /* The key will not be echoed to the screen. To change this, */ /* remove the +IO$M_NOECHO in the $qiow call. */ /* */ /* The actual symbol GETKEY should be defined globally at */ /* login time and the executable image (GETKEY.EXE) should */ /* reside in SYS$LOGIN:, unless you give a directory name */ /* instead. The login line should look like this: */ /* */ /* $ getkey :== $sys$login:getkey */ /* */ /* Note: This program will only run on a VAX/VMS 3.7 or */ /* higher Operating System. */ /* */ /* Example (in DCL): */ /* */ /* $ again: */ /* $ write sys$output "Would you Like to Exit? (Y/N)" */ /* $ getkey response */ /* $ if response .eqs. "Y" .or. response .eqs. "y" then exit */ /* $ goto again */ /* */ /****************************************************************************/ #include iodef #include descrip char inkey (); main (argc,argv) int argc; char *argv[]; { char letter[2]; int i=1; deassign (); letter[1] = 0; for (;(i