Created
March 25, 2014 12:02
-
-
Save bennadel/9760383 to your computer and use it in GitHub Desktop.
ColdFusion 9's IsNull() Works On Non-Struct Objects
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
<cfif ( | |
isStruct( someValue ) && | |
!isNull( someValue.someKey ) | |
)> | |
<!--- Do some conditional logic here... ---> | |
</cfif> |
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
<!--- Create a string value. ---> | |
<cfset myString = "Boo ya!" /> | |
<!--- Check for a property of it. ---> | |
String Key Null: #isNull( myString.someKey )# |
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
<!--- Create a string value. ---> | |
<cfset myString = "Boo ya!" /> | |
<!--- Check for a property of it. ---> | |
String Key Exists: #structKeyExists( myString, "someKey" )# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment