home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / SCAPAGE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.2 KB  |  47 lines

  1. /**
  2. *
  3. * Name        scapage -- Display (activate) a video page
  4. *
  5. * Synopsis    apage = scapage(page);
  6. *
  7. *        int apage      The video page actually displayed.
  8. *        int page      The page to display (activate).
  9. *
  10. * Description    SCAPAGE sets the active display page, i.e., displays the
  11. *        page.  The cursor is not changed in form.
  12. *
  13. *        Use SCMODE to find how many pages are supported by the
  14. *        current device in the current mode.  Use SCPAGE to
  15. *        direct Blaise C TOOLS screen output to a given page,
  16. *        whether it is active (displayed) or not.
  17. *
  18. * Returns    apage          The video page actually displayed.
  19. *
  20. * Version    6.00 (C)Copyright Blaise Computing Inc.  1983,1987,1989
  21. *
  22. **/
  23.  
  24. #include <dos.h>
  25.  
  26. #include <bscreens.h>
  27.  
  28. int scapage(page)
  29. int page;
  30. {
  31.     int        max_page;
  32.     union REGS inregs,outregs;
  33.  
  34.     max_page = scpages() - 1;          /* Maximum page value          */
  35.  
  36.     utbound(page,0,max_page)
  37.  
  38.     if (max_page)              /* Switch active page only if   */
  39.     {                      /* this device supports more    */
  40.        inregs.h.ah = 5;           /* than one.              */
  41.        inregs.h.al = (unsigned char) page;
  42.        int86(16,&inregs,&outregs);
  43.     }
  44.  
  45.     return(page);
  46. }
  47.