[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
FUNCTION AEXTRACT()
Short:
------
AEXTRACT() Extract and return a conditional set from an array
Returns:
--------
<aSubset> => subset of the array
Syntax:
-------
AEXTRACT(aSource,bCondition,[nElement])
Description:
------------
Extracts elements meeting <bCondition> from <aSource>
and returns them as in an array.
<bCondition> is a code block that, for each element
of <aSource> is passed the element and the position. So for
element 3 the codeblock would be called with
EVAL(bCondition,aSource[3],3)
[nElement] if passed signals that <aSource> is an
array of arrays, and that [nElement] is to be extracted from
each subarray where <bCondition> is true.
Examples:
---------
aNames := {"Fred","Wilma","Barney","Betty"}
aRubbels := aextract(aNames,{|e|left(e,1)=="B"} )
aDir := directory()
// extract for size > 100,000
aBig := aextract(aDir,{|e,n|aDir[n,2]> 100000})
// extract only the name element for size > 100,000
aBigNames := aextract(aDir,{|e,n|aDir[n,2]> 100000},1)
Source:
-------
S_AEXTRA.PRG
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson