home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 13.21. Changing Video Modes with SETMODE()
- Author: Greg Lief
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- //───── NOTE: must compile with the /N option!
-
- #define EGA 43
- #define VGA 50
- #define REG 25
- #define SINGLE 80
- #define DOUBLE 40
- #define NOCHANGE 0
-
-
- function main
- local oldrows := maxrow() + 1, oldcols := maxcol() + 1
- cls
- ChangeMode(VGA, SINGLE)
- ChangeMode(NOCHANGE, DOUBLE)
- ChangeMode(REG, 0)
- ChangeMode(oldrows, oldcols)
- return nil
-
- function ChangeMode(rows, cols)
- local ret_val := setmode(rows, cols)
- if ! ret_val
- ? ltrim(str(rows)) + " x " + ltrim(str(cols)) + " mode not available"
- else
- @ maxrow() - 2, 0 say "MAXROW(): " + str(maxrow())
- @ maxrow() - 1, 0 say "MAXCOL(): " + str(maxcol())
- @ maxrow(), 0 say "Current mode: " + ltrim(str(maxrow() + 1)) + ;
- " x " + ltrim(str(maxcol() + 1))
- endif
- inkey(0)
- return ret_val
-
- // end of file CHP1321.PRG
-