Question: I'm trying to find out if a url variable exists, and if it doesn't, make sure that it's not empty.

This does not work:

```
<cfif IsDefined('URL.affiliateId') and is not "">
    //
</cfif>

```

Answer: 
You can simplify the logic a bit as well by using <cfparam> to ensure that the URL variable always exists. Then rather than having 2 conditions, you just need 1.

```
<cfparam name="URL.affiliateId" type="string" default="" />

<cfif trim( URL.affiliateId ) is not "">
     do stuff here
</cfif>
```
I will just sum up the answers and offer my version of it:

```
<cfparam name="URL.affiliateId" type="string" default="" />

<cfif len(trim(URL.affiliateId))>
     ...do something with the affiliate...
</cfif>

```

You do not need structKeyExists or isDefined and it would be better to avoid them. Also you do not need the 'greater than zero' part after the 'len()'.