home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 12.13. Supplying default values for the parameters.
- NOTE: calls SaveEnv() and RestEnv() as found in CHP1207.PRG
- (see also ASKCUST.CH)
- Author: Craig Yellick
- 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
- */
-
- #command default <var> to <value> => ;
- if <var> == nil ; <var> := <value> ; endif
-
- function AskCust(r, c, message, msgColor, defAnswer, pict)
- /*
- General-purpose "which customer #" prompt:
- r row,
- c column,
- message prompt to display at r, c,
- msgColor color to use for message,
- defAnswer default answer to prompt,
- pict picture to use with GET.
-
- Returns end-user's answer to the prompt.
- */
- local answer := defAnswer
- local getlist := {}
-
- default r to row()
- default c to col()
- default message to "Which Customer #?"
- default msgColor to "GR+/B"
- default answer to space(6)
- default pict to "999999"
-
- SaveEnv("GR+/B", 1)
- @ r, c say message get answer picture (pict)
- read
- RestEnv()
-
- return answer
-
- // end of file CHP1213.PRG
-