Created by
SeanB
| //Filters an array according to a passed parameter.
//e.g.
//move (FilterArray(aStringList,self,get_is_uppercase)) to aStringList
Function FilterArray Global Variant[] aVariant Integer hObj Integer iMsg Returns Variant[]
Variant[] aReturn
Integer iPos
Integer iCopied
Integer iMax
Boolean isOK
Move (SizeOfArray(aVariant)) to iMax
For iPos from 0 to (iMax-1)
Get iMsg of hObj aVariant[iPos] to isOK
If (isOK) Begin
Move aVariant[iPos] to aVariant[iCopied]
Move (iCopied+1) to iCopied
End
Loop
Move (ResizeArray(aVariant,iCopied)) to aVariant
Function_Return aVariant
End_Function
|