Greg's Blog

helping me remember what I figure out

StructKeyExists() vs isDefined()

| Comments

There was a thread on CF-talk the other week titled the same as this little entry, where the the difference between these two functions was asked and what the benefits, performance considerations were when using either option. I was going to write up something about this thread, but Sean Corfield has already done it and superbly summarised it. Go check it out as it really explains how these two functions work [i.e. how they determine whether or not that variable in question exists]. For a full discussion of the thread have a look here.

The upshot? If you are using CFMX all vars are held as structures, so you’ll get the best out of using StructKeyExists().