home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name utpause -- Display a message and wait for a key to be
- * pressed at the keyboard.
- *
- * Synopsis iret = utpause(pmessage);
- *
- * int iret 0 is always returned
- * char *pmessage Message to be displayed
- *
- * Description UTPAUSE displays a message on the active display page
- * (which is not necessarily the current display page),
- * followed by the prompt
- *
- * Press any key when ready ...
- *
- * When a key is struck on the main console, the function
- * returns.
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <string.h>
-
- #include <bkeybd.h>
- #include <bscreen.h>
-
- #define LF ((char) 10) /* Line feed (CTRL-J) */
- #define CR ((char) 13) /* Carriage return (CTRL-M) */
-
- int utpause(pmessage)
- char *pmessage;
- {
- int scan;
- int row,col,fore,back;
- int old_page,mode,columns,act_page;
-
- old_page = b_curpage; /* Save former current page. */
- scmode(&mode,&columns,&act_page);
- scpage(act_page); /* Direct output to active page.*/
-
- if (strlen(pmessage) != 0)
- {
- sccurpos(&row,&col);
- scwrstr(row,col,0,pmessage,-1,-1,CHARS_ONLY
- + MOVE_CUR + CUR_AFTER);
- scttywrt(CR,1);
- scttywrt(LF,1);
- }
-
- sccurpos(&row,&col);
- scread(&fore,&back);
- scdspmsg(row,col,fore,back,"Press any key when ready ...");
- kbflush();
- kbin(&scan);
-
- scpage(old_page); /* Restore former current page. */
-
- return(0);
- }