This can be optimized as ...
<CFIF NOT IsDefined("ATTRIBUTES.Request_Time") OR NOT
Trim(ATTRIBUTES.Request_Time)>
... Request_Time is not available
<CFELSE>
... Request_Time is available
</CFIF>
Regards,
Steve
-----Original Message-----
From: Ben Lowndes [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 07, 2000 2:24 PM
To: [EMAIL PROTECTED]
Subject: Most efficeint validation
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.
------------------------------------------------------------------------------
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.