Last active
August 29, 2015 14:21
-
-
Save seanbamforth/c016d990233ddb9bbc1a to your computer and use it in GitHub Desktop.
Dataflex Filter function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment