home *** CD-ROM | disk | FTP | other *** search
- /*
- Program: BLINDS.PRG
- System: GRUMPFISH LIBRARY
- Author: Greg Lief
- Copyright (c) 1988-90, Greg Lief
- Clipper 5.x version
- Compile instructions: clipper blinds /n/w/a
-
- Procs & Fncts: BLINDOPEN()
- : BLINDCLOSE()
- */
-
- //───── begin preprocessor directives
-
- #include "fileio.ch"
- #include "grump.ch"
-
- //───── end preprocessor directives
-
- /*
- Function: BLINDOPEN()
- Purpose: Draw title screen using blinds effect
- NOTE: Title screen must be pre-saved using SAVE_DRAPE()
- Syntax: Blindopen(<name of screen file>, [<delay>])
- Default delay is 5
- WILL HANDLE 25/43/50 ROW DISPLAYS
- */
- function blindopen(cfile, ndelay)
- local nhandle, screen_[maxcol() + 1], xx, yy, maxrow := maxrow() + 1, ;
- nbufferlen := (maxrow() + 1) * 2, buffer, maxcol := maxcol() + 1
- default ndelay to 5
- if file(cfile)
- nhandle := fopen(cfile, FO_READ)
- //───── verify that this file was saved in the same mode that we are in
- //───── because if it wasn't, all hell will break loose further down
- if ( xx := fseek(nhandle, 0, FS_END) ) == maxrow * maxcol * 2 .or. ;
- xx == (maxrow * maxcol * 2) + 4
- fseek(nhandle, (xx - maxrow * maxcol * 2), FS_SET) // reset to start
- buffer := space(nbufferlen)
- for xx = 1 to maxcol
- fread(nhandle, @buffer, nbufferlen)
- screen_[xx] := buffer
- next
- //───── note: xx and yy are still set up for 80-column mode
- //───── will have to change this... eventually...
- for xx = 0 to 9
- for yy = 0 to 7
- restscreen(0, yy * 10 + xx, maxrow - 1, yy * 10 + xx, ;
- screen_[yy * 10 + xx + 1])
- next
- for yy = 1 to ndelay
- next
- next
- endif
- fclose(nhandle)
- endif
- return NIL
-
- * end function BlindOpen()
- *--------------------------------------------------------------------*
-
-
- /*
- Function: BLINDCLOSE()
- Purpose: Clear screen using blinds effect
- Syntax: BlindClose([<ndelay>])
- Default ndelay is 10
- */
- function blindclose(ndelay)
- local xx, yy, maxrow := maxrow()
- default ndelay to 10
- //───── still set up for 80-column - will have to change this... eventually...
- for xx = 9 to 0 step -1
- for yy = 7 to 0 step -1
- scroll(0, yy * 10 + xx, maxrow, yy * 10 + xx, 0)
- next
- for yy = 1 to ndelay
- next
- next
- return NIL
-
- * end function BlindClose()
- *--------------------------------------------------------------------*
-
- * eof blinds.prg
-