home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP07.EXE / CHP0704.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.0 KB  |  37 lines

  1. /*
  2.    Listing 7.4 ShowMsg()
  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. #translate showmsg( [MSG <msg>] [BOXCOL <boxcol>] [MSGCOL <msgcol>] ) ;
  14.            => showmsg( <msg>, <boxcol>, <msgcol> )
  15.  
  16. function showmsg(msg, boxcolor, msgcolor)
  17. local oldcolor, buffer, leftcol := int(76 - len(msg)) / 2
  18. // assign box color if not passed as parameter
  19. if boxcolor = NIL
  20.    boxcolor := 'w/r'
  21. endif
  22. // assign message color if not passed as parameter
  23. if msgcolor = NIL
  24.    msgcolor := '+w/r'
  25. endif
  26. buffer := savescreen(11, leftcol, 13, 80 - leftcol)
  27. oldcolor := setcolor(boxcolor)
  28. @ 11, leftcol, 13, 80 - leftcol box '+-+|+-+| '
  29. setcolor(msgcolor)
  30. @ 12, leftcol + 2 say msg
  31. inkey(2)
  32. restscreen(11, leftcol, 13, 80 - leftcol, buffer)
  33. setcolor(oldcolor)
  34. return nil
  35.  
  36. // end of file CHP0704.PRG
  37.