Created
March 26, 2012 13:40
-
-
Save nkostic/2205099 to your computer and use it in GitHub Desktop.
Get Max Value of Key InS truct Array
This file contains 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
<cffunction name="GetMaxValueOfKeyInStructArray" access="public" returntype="numeric" output="false"> | |
<cfargument name="StructArray" type="any" required="true" /> | |
<cfargument name="StructKey" type="any" required="true" /> | |
<cfscript> | |
sqlMax=0; | |
temp=0; | |
for(i=1; i <= ArrayLen(arguments.StructArray); i=i+1){ | |
if(StructFind(arguments.StructArray[i], "#arguments.StructKey#")){ | |
temp=StructFind(arguments.StructArray[i], "#arguments.StructKey#"); | |
if(temp>sqlMax){ | |
sqlMax=temp; | |
} | |
} | |
} | |
return sqlMax; | |
</cfscript> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment