Created
August 23, 2017 17:10
-
-
Save bardware/5153f480a6fe800de7eea220ea2ef3fd to your computer and use it in GitHub Desktop.
How to use Coldfusion's ListFilter in a 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
| <cffunction name="fktA" returntype="string"> | |
| <cfargument name="struExcludeCols" type="struct"> | |
| <cfset local.strLst = "Listel1,Listel2,Listel3"> | |
| <cfscript> | |
| local.columnNames = ListFilter( | |
| strLst, | |
| function( strCol ) { | |
| return not StructKeyExists( Arguments.struExcludeCols, strCol ); | |
| } | |
| ); | |
| </cfscript> | |
| <cfreturn local.columnNames> | |
| </cffunction> | |
| <cfdump var="#fktA( { "Listel2" = 1 } )#"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment