Structkeyexists or Yes, No, Maybe So
Perhaps I'm just being picky here but why do some functions in CF return a boolean (true/false) and others return a boolean (yes/no)?
For example StruckKeyExists() is one such culprit it returns a Yes or a No, which in CF is boolean. The problem naturally comes in if you decide to send the results from a StructKeyExits to a language that doesn't understand that yes/no in reality means true/false. Even if you use the serializeJSON() function to convert your data to a JSON formatted string, the Yes/NO does not convert to a boolean in JavaScript whereas a True/False is. In fact serializeJSON converts Yes/No to a string!
The CF9 documentation for StructKeyExists even indicates that the result of the function is True if the key exists. They say nothing about Yes.


Subscribe via RSS
Follow me on Twitter