[thelist] Classic ASP: Someone else's code

Chris at globet.com Chris at globet.com
Tue Nov 22 12:14:45 CST 2005


Casey

> What exactly is going on here:
> 
> if trim(Contact_First_x) & "" <> "" AND trim(Contact_Last_x) 
> & "" <> "" then
> 
> In case it's not clear in the email:  "" <> ""  which is: 
> double-quote double-quote <> double-quote double-quote
> 
> I'm not at all understanding the logic of this statement.... anyone?

My take on this is as follows:

If Contact_First_x is a string consisting only of spaces, then it will
not be equal to "", so the Trim(string) function is used. A zero length
string is appended to Trim(Contact_First_x) to handle Null values. The
same is done for Contact_Last_x.

A value of True is returned from the boolean expression if:
Contact_First_x is not Null, Contact_First_x does not contain only
spaces, Contact_First_x is not a zero length string AND Contact_Last_x
is not Null, Contact_Last_x does not contain only spaces, Contact_Last_x
is not a zero length string.

In other words, input is required for both fields that have their values
applied to these variables.

HTH

Chris Marsh
Web Developer
http://www.globet.com/
Tel: +44 20 8246 4804 Ext 828
Fax: +44 20 8246 4808

Any opinions expressed in this email are those of the individual and not
necessarily the Company. This message is intended for the use of the
individual or entity to which it is addressed and may contain
information that is confidential and privileged and exempt from
disclosure under applicable law. If the reader of this message is not
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly prohibited.
If you have received this communication in error, please contact the
sender immediately and delete it from your system. 



More information about the thelist mailing list