home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 9.5. Same function as listing 9.4, without macros.
- 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
- */
-
- function Gimme(bWhat, bWhere, cStart)
- /*
- Returns array filled with the result of the
- "what" code block, for all records where the
- "where" code block returns true.
- Start processing by seeking the "start" value.
-
- Example:
-
- who_ := CUST->(Gimme( {|| name }, ; // What to return
- {|| state == "MN"}, ; // Condition
- "MN" )) // Where to start
-
- */
- local these_ := {}
- seek cStart
- do while eval(bWhere)
- aadd(these_, eval(bWhat))
- skip
- enddo
- return these_
-
- // end of file CHP0905.PRG
-