home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP13.EXE / CHP1321.PRG < prev    next >
Encoding:
Text File  |  1991-06-12  |  1.1 KB  |  44 lines

  1. /*
  2.    Listing 13.21. Changing Video Modes with SETMODE()
  3.    Author: Greg Lief
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. //───── NOTE: must compile with the /N option!
  12.  
  13. #define EGA       43
  14. #define VGA       50
  15. #define REG       25
  16. #define SINGLE    80
  17. #define DOUBLE    40
  18. #define NOCHANGE   0
  19.  
  20.  
  21. function main
  22. local oldrows := maxrow() + 1, oldcols := maxcol() + 1
  23. cls
  24. ChangeMode(VGA, SINGLE)
  25. ChangeMode(NOCHANGE, DOUBLE)
  26. ChangeMode(REG, 0)
  27. ChangeMode(oldrows, oldcols)
  28. return nil
  29.  
  30. function ChangeMode(rows, cols)
  31. local ret_val := setmode(rows, cols)
  32. if ! ret_val
  33.    ? ltrim(str(rows)) + " x " + ltrim(str(cols)) + " mode not available"
  34. else
  35.    @ maxrow() - 2, 0 say "MAXROW(): " + str(maxrow())
  36.    @ maxrow() - 1, 0 say "MAXCOL(): " + str(maxcol())
  37.    @ maxrow(),     0 say "Current mode: " + ltrim(str(maxrow() + 1)) + ;
  38.                          " x " + ltrim(str(maxcol() + 1))
  39. endif
  40. inkey(0)
  41. return ret_val
  42.  
  43. // end of file CHP1321.PRG
  44.