home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP09.EXE / CHP0905.PRG < prev    next >
Encoding:
Text File  |  1991-06-01  |  924 b   |  34 lines

  1. /*
  2.    Listing 9.5. Same function as listing 9.4, without macros.
  3.    Author: Craig Yellick
  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. function Gimme(bWhat, bWhere, cStart)
  12. /*
  13.    Returns array filled with the result of the
  14.    "what" code block, for all records where the
  15.    "where" code block returns true.
  16.    Start processing by seeking the "start" value.
  17.  
  18.    Example:
  19.  
  20.      who_ := CUST->(Gimme( {|| name }, ;          // What to return
  21.                            {|| state == "MN"}, ;  // Condition
  22.                            "MN" ))                // Where to start
  23.  
  24. */
  25. local these_ := {}
  26.   seek cStart
  27.   do while eval(bWhere)
  28.     aadd(these_, eval(bWhat))
  29.     skip
  30.   enddo
  31. return these_
  32.  
  33. // end of file CHP0905.PRG
  34.