home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 5.ddi / C / UTPAUSE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.5 KB  |  62 lines

  1. /**
  2. *
  3. * Name        utpause -- Display a message and wait for a key to be
  4. *               pressed at the keyboard.
  5. *
  6. * Synopsis    iret = utpause(pmessage);
  7. *
  8. *        int  iret      0 is always returned
  9. *        char *pmessage      Message to be displayed
  10. *
  11. * Description    UTPAUSE displays a message on the active display page
  12. *        (which is not necessarily the current display page),
  13. *        followed by the prompt
  14. *
  15. *            Press any key when ready ...
  16. *
  17. *        When a key is struck on the main console, the function
  18. *        returns.
  19. *
  20. * Version    3.0 (C)Copyright Blaise Computing Inc.    1983, 1984, 1986
  21. *
  22. **/
  23.  
  24. #include <string.h>
  25.  
  26. #include <bkeybd.h>
  27. #include <bscreen.h>
  28.  
  29. #define  LF    ((char) 10)    /* Line feed     (CTRL-J)          */
  30. #define  CR    ((char) 13)    /* Carriage return (CTRL-M)          */
  31.  
  32. int utpause(pmessage)
  33. char *pmessage;
  34. {
  35.     int  scan;
  36.     int  row,col,fore,back;
  37.     int  old_page,mode,columns,act_page;
  38.  
  39.     old_page = b_curpage;          /* Save former current page.    */
  40.     scmode(&mode,&columns,&act_page);
  41.     scpage(act_page);              /* Direct output to active page.*/
  42.  
  43.     if (strlen(pmessage) != 0)
  44.     {
  45.     sccurpos(&row,&col);
  46.     scwrstr(row,col,0,pmessage,-1,-1,CHARS_ONLY
  47.                      + MOVE_CUR + CUR_AFTER);
  48.     scttywrt(CR,1);
  49.     scttywrt(LF,1);
  50.     }
  51.  
  52.     sccurpos(&row,&col);
  53.     scread(&fore,&back);
  54.     scdspmsg(row,col,fore,back,"Press any key when ready ...");
  55.     kbflush();
  56.     kbin(&scan);
  57.  
  58.     scpage(old_page);              /* Restore former current page. */
  59.  
  60.     return(0);
  61. }
  62.