[thelist] [CF] Value of a url var with no value
Raymond Camden
jedimaster at macromedia.com
Mon Jul 30 11:13:53 CDT 2001
The value should be "". CF has no concept of 'null'.
If you want to combine a test for foo not existing or equal to "", you can
do:
<CFPARAM NAME="URL.Foo" DEFAULT="">
Then you can test for either the non existance or empty value of by doing:
<CFIF URL.Foo IS "">
or even better (quicker)
<CFIF NOT Len(Trim(URL.Foo))>
=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email : jedimaster at macromedia.com
ICQ UIN : 3679482
"My ally is the Force, and a powerful ally it is." - Yoda
> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of Warden, Matt
> Sent: Monday, July 30, 2001 12:11 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] [CF] Value of a url var with no value
>
>
>
> Hey thelist,
>
> Don't tell anyone, but I'm doing a little something in CF.
>
> What has be stuck (and google was no
> help:
> http://www.google.com/search?hl=en&safe=off&q=undefined+coldfusion
> +variable+url+querystring
> ) is the value in CF of a querystring variable with no value. For
> instance, what is the value in CF of the querystring var named foo?
>
> http://www.codyblog.com/marshall/index.cfm?foo=
>
> I'm assuming that since foo= appears in the url, that whatever that value
> is overrides the default in the <cfparam ...> tag. But, I don' tknow what
> that value is.
>
> I did a little test:
>
> <cfswitch expression="#url.foo#">
>
> <cfcase value=",0,null" delimiters=",">
> <cfinclude template="foo.cfm">
> </cfcase>
>
> <cfdefaultcase>
> <cfinclude template="bar.cfm">
> </cfdefaultcase>
>
> </cfswitch>
>
More information about the thelist
mailing list