--------------44B4474618C06900D3D31FC6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Try this
<CFIF IsDefined("ATTRIBUTES.Request_time") AND Trim(ATTRIBUTES.Request_time) NEQ "")
  Request_time is defined
<CFELSE>
  Request_time is not defined
</CFIF>
This called shortcut validation.  Trim(ATTRIBUTES.Request_time) NEQ "" will validate 
only if the first one is true.

Tinh Tran
Event411.com

Ben Lowndes wrote:

> Hello,
>
> I've just been trying to figure out the most efficent way to check for a
> passed (form or url) variables pesence and value. The code I've been using
> is:
>
> <CFIF (IsDefined("ATTRIBUTES.Request_time") IS "No") OR
> (Trim(ATTRIBUTES.Request_time) IS "")>
> Request_time is not defined
> <CFELSE>
> Request_time is defined
> </CFIF>
>
> But is this the best way, it must be a common problem. I also thought about
> using :
>
> <CFPARAM NAME="ATTRIBUTES.Request_Time" DEFAULT="0">
> <CFIF Trim(RequestTime) IS "0">
> Request_time is not defined
> <CFELSE>
> Request_time is defined
> </CFIF>
>
> but that doesn't work as it doesn't apply the value 0 if Request_time is
> passed but not defined... So is the first method the best?
>
> Thanks
> Ben
>
> ------------------------------------------------------------------------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
>message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

--------------44B4474618C06900D3D31FC6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Try this
<br>&lt;CFIF IsDefined("ATTRIBUTES.Request_time") AND Trim(ATTRIBUTES.Request_time)
NEQ "")
<br>&nbsp; Request_time is defined
<br>&lt;CFELSE>
<br>&nbsp; Request_time is not defined
<br>&lt;/CFIF>
<br>This called shortcut validation.&nbsp; Trim(ATTRIBUTES.Request_time)
NEQ "" will validate only if the first one is true.
<p>Tinh Tran
<br>Event411.com
<p>Ben Lowndes wrote:
<blockquote TYPE=CITE>Hello,
<p>I've just been trying to figure out the most efficent way to check for
a
<br>passed (form or url) variables pesence and value. The code I've been
using
<br>is:
<p>&lt;CFIF (IsDefined("ATTRIBUTES.Request_time") IS "No") OR
<br>(Trim(ATTRIBUTES.Request_time) IS "")>
<br>Request_time is not defined
<br>&lt;CFELSE>
<br>Request_time is defined
<br>&lt;/CFIF>
<p>But is this the best way, it must be a common problem. I also thought
about
<br>using :
<p>&lt;CFPARAM NAME="ATTRIBUTES.Request_Time" DEFAULT="0">
<br>&lt;CFIF Trim(RequestTime) IS "0">
<br>Request_time is not defined
<br>&lt;CFELSE>
<br>Request_time is defined
<br>&lt;/CFIF>
<p>but that doesn't work as it doesn't apply the value 0 if Request_time
is
<br>passed but not defined... So is the first method the best?
<p>Thanks
<br>Ben
<p>------------------------------------------------------------------------------
<br>Archives: <a 
href="http://www.eGroups.com/list/cf-talk">http://www.eGroups.com/list/cf-talk</a>
<br>To Unsubscribe visit <a 
href="http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk">http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;body=lists/cf_talk</a>
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.</blockquote>
</html>

--------------44B4474618C06900D3D31FC6--


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to