home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / BLINDS.PRG < prev    next >
Encoding:
Text File  |  1991-04-23  |  2.5 KB  |  86 lines

  1. /*
  2.    Program: BLINDS.PRG
  3.    System: GRUMPFISH LIBRARY
  4.    Author: Greg Lief
  5.    Copyright (c) 1988-90, Greg Lief
  6.    Clipper 5.x version
  7.    Compile instructions: clipper blinds /n/w/a
  8.  
  9.    Procs & Fncts: BLINDOPEN()
  10.                 : BLINDCLOSE()
  11. */
  12.  
  13. //───── begin preprocessor directives
  14.  
  15. #include "fileio.ch"
  16. #include "grump.ch"
  17.  
  18. //───── end preprocessor directives
  19.  
  20. /*
  21.    Function: BLINDOPEN()
  22.    Purpose:  Draw title screen using blinds effect
  23.    NOTE:     Title screen must be pre-saved using SAVE_DRAPE()
  24.    Syntax:   Blindopen(<name of screen file>, [<delay>])
  25.              Default delay is 5
  26.    WILL HANDLE 25/43/50 ROW DISPLAYS
  27. */
  28. function blindopen(cfile, ndelay)
  29. local nhandle, screen_[maxcol() + 1], xx, yy, maxrow := maxrow() + 1, ;
  30.       nbufferlen := (maxrow() + 1) * 2, buffer, maxcol := maxcol() + 1
  31. default ndelay to 5
  32. if file(cfile)
  33.    nhandle := fopen(cfile, FO_READ)
  34.    //───── verify that this file was saved in the same mode that we are in
  35.    //───── because if it wasn't, all hell will break loose further down
  36.    if ( xx := fseek(nhandle, 0, FS_END) ) == maxrow * maxcol * 2 .or. ;
  37.         xx == (maxrow * maxcol * 2) + 4
  38.       fseek(nhandle, (xx - maxrow * maxcol * 2), FS_SET) // reset to start
  39.       buffer := space(nbufferlen)
  40.       for xx = 1 to maxcol
  41.          fread(nhandle, @buffer, nbufferlen)
  42.          screen_[xx] := buffer
  43.       next
  44.       //───── note: xx and yy are still set up for 80-column mode
  45.       //─────       will have to change this... eventually...
  46.       for xx = 0 to 9
  47.          for yy = 0 to 7
  48.             restscreen(0, yy * 10 + xx, maxrow - 1, yy * 10 + xx, ;
  49.                        screen_[yy * 10 + xx + 1])
  50.          next
  51.          for yy = 1 to ndelay
  52.          next
  53.       next
  54.    endif
  55.    fclose(nhandle)
  56. endif
  57. return NIL
  58.  
  59. * end function BlindOpen()
  60. *--------------------------------------------------------------------*
  61.  
  62.  
  63. /*
  64.    Function: BLINDCLOSE()
  65.    Purpose:  Clear screen using blinds effect
  66.    Syntax:   BlindClose([<ndelay>])
  67.              Default ndelay is 10
  68. */
  69. function blindclose(ndelay)
  70. local xx, yy, maxrow := maxrow()
  71. default ndelay to 10
  72. //───── still set up for 80-column - will have to change this... eventually...
  73. for xx = 9 to 0 step -1
  74.    for yy = 7 to 0 step -1
  75.       scroll(0, yy * 10 + xx, maxrow, yy * 10 + xx, 0)
  76.    next
  77.    for yy = 1 to ndelay
  78.    next
  79. next
  80. return NIL
  81.  
  82. * end function BlindClose()
  83. *--------------------------------------------------------------------*
  84.  
  85. * eof blinds.prg
  86.