home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SAMPLES.EXE / T_SCRNS.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  2.5 KB  |  105 lines

  1. *****************************************************************
  2. * Test program for SCRNPOP, SCRNPUSH, SCRNWRIT, SCRNLOAD, SCRNCLR
  3. * FILE = T_SCRNS.PRG
  4. *****************************************************************
  5.  
  6. * Copyright(c) 1991 -- James Occhiogrosso
  7.  
  8. # include "box.ch"
  9. # include "dl_keys.ch"
  10. # include "inkey.ch"
  11.  
  12. SETCOLOR('w+/b')
  13. CLEAR
  14. SET CURSOR OFF
  15.  
  16. * Enable high intensity background colors
  17. SETBLINK(.F.)
  18.  
  19. * Stuff a space in keyboard to start the loop
  20. KEYBOARD CHR(K_SPACE)
  21. DO WHILE INKEY(0)  != K_ESC
  22.  
  23.     * Fill screen with bright white on red background character
  24.     CLEAR
  25.     BACKCHAR(,,,,,'w+/r')
  26.     @ 24, 33 SAY ' Press a key '
  27.  
  28.     * Display and shadow four boxed areas. High intensity
  29.     * foregrounds and backgrounds are used differently
  30.     * with each box to demonstrate possibilities.
  31.  
  32.     old_color = SETCOLOR('W+/R*')
  33.     @ 1, 10, 10, 70 box B_SINGLE + CHR(2)
  34.     SHADOW(1, 10, 10, 70, 239)
  35.     SCRNPUSH(1, 10, 10, 70)
  36.     SETCOLOR(old_color)
  37.     INKEY(0)
  38.     CLRSHADOW()
  39.  
  40.     @ 5, 20, 21, 40 box B_SINGLE + CHR(3)
  41.     SHADOW(5, 20, 21, 40, 96)
  42.     SCRNPUSH(5, 20, 21, 40)
  43.     INKEY(0)
  44.     CLRSHADOW()
  45.  
  46.     SETCOLOR('W+/BG')
  47.     @ 3, 45, 20, 65 box B_SINGLE + CHR(4)
  48.     SHADOW(3, 45, 20, 65, 240)
  49.     SETCOLOR(old_color)
  50.     SCRNPUSH(3, 45, 20, 65)
  51.     INKEY(0)
  52.     CLRSHADOW()
  53.  
  54.     SETCOLOR('W+*/B')
  55.     @ 13, 10, 18, 75 box B_SINGLE + CHR(5)
  56.     SHADOW(13, 10, 18, 75)
  57.     SETCOLOR(old_color)
  58.     SCRNPUSH(13, 10, 18, 75)
  59.     INKEY(0)
  60.     CLRSHADOW()
  61.  
  62.     * Write the current screens array to a file
  63.     SCRNWRIT('screens1')
  64.     * And clear the screens stack
  65.     SCRNCLR()
  66.  
  67.     CLEAR SCREEN
  68.     @ 24, 18 SAY ' Press any key to restore the screens from disk'
  69.     INKEY(0)
  70.  
  71.     * Display and push another screen without pausing
  72.  
  73.     SETCOLOR('N*/BG')
  74.     @ 15, 2, 17, 46 box B_SINGLE + ' '
  75.     @ 16, 4 SAY 'This screen was saved in a different file'
  76.  
  77.     * Put new screen on stack, write to screens2, and clear stack
  78.     SCRNPUSH(15, 2, 17, 46)
  79.     SETCOLOR(old_color)
  80.     CLEAR SCREEN
  81.     SCRNWRIT('screens2')
  82.     SCRNCLR()
  83.  
  84.  
  85.     * Load all screens on stack with latest in position 1
  86.     SCRNLOAD('screens2')
  87.     SCRNLOAD('screens1')
  88.  
  89.     * Restore screens in reverse order (except last one)
  90.     BACKCHAR(,,,,,'w+/r')
  91.     @ 24, 33 SAY ' Press a key '
  92.     WHILE SCRNPOP() != 0
  93.         INKEY(0)
  94.     ENDDO
  95.  
  96.     @ 24, 18 SAY '  Press any key to begin again or Esc to exit   '
  97.  
  98. ENDDO
  99.  
  100. SET CURSOR ON
  101. CLEAR
  102. RETURN
  103.  
  104.  
  105.