isDefined or "" doesn't work

Posted on 2006-03-22
Last Modified: 2013-12-24

I invoked a cfc.

Here is what I get for my dump <cfdump var="#letterbody_guarRet#">
query - Rows: 1
1 {ts '2000-04-07 00:00:00'}  first_name   guar_city  guarantor_fname  guarantor_lname  SC  12345

Notice there is no information for GUARADDR1.  That is correct. I'm trying to
have an if statement to direct what to do in that situation. However nothing
seems to work.  

When I use
<cfif not isDefined('letterbody_guarRet.guaraddr1')

it doesn't work.
I tried it the opposite way:
 <cfif isDefined('letterbody_guarRet.guaraddr1')

and that worked so the  'letterbody_guarRet.guaraddr1' must be defined as something.  

I tried:
<cfif #letterbody_guarRet.guaraddr1# is "">
and that didn't work either.

What can I use if isDefined and "" doesn't work?
Question by:djb80
    LVL 10

    Accepted Solution

    Try <cfif letterbody_guarRet.guaraddr1 EQ "">

    If that doesnt work try:

    <cfif Trim(letterbody_guarRet.guaraddr1) EQ "">
    LVL 10

    Expert Comment

    Also, if neither of those work for some reason you may try:

    <cfif Len(Trim(letterbody_guarRet.guaraddr1)) EQ 0>
    LVL 16

    Expert Comment

    I think I've read that the fastest is
    <CFIF Len(TRIM(letterbody_guarRet.guaraddr1))>
      it has data here
      No data here
    LVL 18

    Expert Comment


    Your problem is simple, this line

    <cfif #letterbody_guarRet.guaraddr1# is "">

    Should be

    <cfif letterbody_guarRet.guaraddr1 is "">


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now