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

  1. /*
  2.    Listing 12.13. Supplying default values for the parameters.
  3.    NOTE: calls SaveEnv() and RestEnv() as found in CHP1207.PRG
  4.    (see also ASKCUST.CH)
  5.    Author: Craig Yellick
  6.    Excerpted from "Clipper 5: A Developer's Guide"
  7.    Copyright (c) 1991 M&T Books
  8.                       501 Galveston Drive
  9.                       Redwood City, CA 94063-4728
  10.                       (415) 366-3600
  11. */
  12.  
  13. #command default <var> to <value> => ;
  14.          if <var> == nil ; <var> := <value> ; endif
  15.  
  16. function AskCust(r, c, message, msgColor, defAnswer, pict)
  17. /*
  18.    General-purpose "which customer #" prompt:
  19.      r          row,
  20.      c          column,
  21.      message    prompt to display at r, c,
  22.      msgColor   color to use for message,
  23.      defAnswer  default answer to prompt,
  24.      pict       picture to use with GET.
  25.  
  26.    Returns end-user's answer to the prompt.
  27. */
  28. local answer := defAnswer
  29. local getlist := {}
  30.  
  31.   default r         to row()
  32.   default c         to col()
  33.   default message   to "Which Customer #?"
  34.   default msgColor  to "GR+/B"
  35.   default answer    to space(6)
  36.   default pict      to "999999"
  37.  
  38.   SaveEnv("GR+/B", 1)
  39.   @ r, c say message get answer picture (pict)
  40.   read
  41.   RestEnv()
  42.  
  43. return answer
  44.  
  45. // end of file CHP1213.PRG
  46.