Blog Post RSS ?

Blogs » ColdFusion » IsDefined() vs. structKeyExists()
 

IsDefined() vs. structKeyExists()

by Eric Jones

Sean Corfield recently blogged about the choice to use IsDefined vs. structKeyExists when trying to determine if a scoped variable (session, application, request, form url etc), exists or not.

Sean talks about how certain dot noted variables will or won’t be seen with IsDefined, BUT I found the fact that IsDefined looks for ANY possible definition even when the variable you’re searching for has been scoped.

Read his blurb to get the full effect.

If you liked this blog, share the love:

  • Save to Del.icio.us

This post has 2 responses so far

  1. The first paragraph is an incomplete sentence… *what* are you trying to determine?!

     
  2. fixed sorry about that, must have gotten lost in my cut / paste.

     

Sponsored Links

Leave a response

You are not logged in, log in with your SitePoint Forum username and password.

-OR- Post Anonymously

* Make sure any code samples are escaped (i.e. ‘<b>’ becomes ‘&lt;b&gt;’).

If not logged in, your comments will be placed in a moderation queue. This means your comment may not appear until one of our moderators approves it.

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Logo Design, Web page Design and more!

99designs

  • Custom logo designs created ‘just for you’.
  • Pick the design you like best.
  • Only pay if you’re satisfied with the result.

The Web Site Revenue Maximizer

New Release

Free PDF Download:

101 Ways To Make Money From Your Website!

Free eBook! Firefox Revealed