home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 7.4 ShowMsg()
- 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!
-
- #translate showmsg( [MSG <msg>] [BOXCOL <boxcol>] [MSGCOL <msgcol>] ) ;
- => showmsg( <msg>, <boxcol>, <msgcol> )
-
- function showmsg(msg, boxcolor, msgcolor)
- local oldcolor, buffer, leftcol := int(76 - len(msg)) / 2
- // assign box color if not passed as parameter
- if boxcolor = NIL
- boxcolor := 'w/r'
- endif
- // assign message color if not passed as parameter
- if msgcolor = NIL
- msgcolor := '+w/r'
- endif
- buffer := savescreen(11, leftcol, 13, 80 - leftcol)
- oldcolor := setcolor(boxcolor)
- @ 11, leftcol, 13, 80 - leftcol box '+-+|+-+| '
- setcolor(msgcolor)
- @ 12, leftcol + 2 say msg
- inkey(2)
- restscreen(11, leftcol, 13, 80 - leftcol, buffer)
- setcolor(oldcolor)
- return nil
-
- // end of file CHP0704.PRG
-