home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP04.EXE / CHP0403.PRG < prev    next >
Encoding:
Text File  |  1991-06-12  |  929 b   |  33 lines

  1. /*
  2.    Listing 4.3 Showmsg() with the NIL datatype
  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. #include "Box.ch"
  14.  
  15. function ShowMsg(msg, boxcolor, msgcolor)
  16. local buffer, leftcol := int(76 - len(msg)) / 2
  17. // assign box color
  18. if boxcolor == NIL .or. valtype(boxcolor) <> "C"
  19.    boxcolor := 'W/R'
  20. endif
  21. // assign message color
  22. if msgcolor == NIL .or. valtype(msgcolor) <> "C"
  23.    msgcolor := '+W/R'
  24. endif
  25. buffer := savescreen(11, leftcol, 13, 80 - leftcol)
  26. dispbox(11, leftcol, 13, 80 - leftcol, B_DOUBLE + ' ', boxcolor)
  27. @ 12, leftcol + 2 say msg color msgcolor
  28. inkey(2)
  29. restscreen(11, leftcol, 13, 80 - leftcol, buffer)
  30. return NIL
  31.  
  32. // end of file CHP0403.PRG
  33.