home *** CD-ROM | disk | FTP | other *** search
- /*
- * getdigit.c
- * contains: getdigit()
- *
- */
-
- #include <stdio.h>
- #include "ibmkeys.h"
- #include "gfuncts.h"
-
- /*
- * char
- * getdigit(void)
- *
- * ARGUMENT
- * (none)
- *
- * DESCRIPTION
- * Processing is suspended awaiting a keystroke. If the keystroke is a
- * digit or ESCape, the ASCII value is returned. If the keystroke is a
- * digit it is output via putchar() also.
- *
- * RETURNS
- * Ascii value of numeric key entry or ESC (0x1b)
- *
- * AUTHOR
- * Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- */
- char GF_CONV getdigit()
- {
- unsigned c;
-
- while (FOREVER) {
- c = getkey();
- if(gisdigit((char)c)) {
- putchar((char)c);
- return (char)c;
- }
- if(c==ESC)
- return (char)c;
- }
- }
-