• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

isDefined or "" doesn't work


I invoked a cfc.

Here is what I get for my dump <cfdump var="#letterbody_guarRet#">
query - Rows: 1
   APPT_DATE   FIRST_NAME GUARADDR1 GUARCITY GUARFNME GUARNME
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?
0
djb80
Asked:
djb80
  • 2
1 Solution
 
js_vaughanCommented:
Try <cfif letterbody_guarRet.guaraddr1 EQ "">

If that doesnt work try:

<cfif Trim(letterbody_guarRet.guaraddr1) EQ "">
0
 
js_vaughanCommented:
Also, if neither of those work for some reason you may try:

<cfif Len(Trim(letterbody_guarRet.guaraddr1)) EQ 0>
0
 
RCorfmanCommented:
I think I've read that the fastest is
<CFIF Len(TRIM(letterbody_guarRet.guaraddr1))>
  it has data here
<CFELSE>
  No data here
</CFIF>
0
 
PluckaCommented:
djb80,

Your problem is simple, this line

<cfif #letterbody_guarRet.guaraddr1# is "">

Should be

<cfif letterbody_guarRet.guaraddr1 is "">

Regards
Plucka
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now