Logic Problem.

if                  (LEN(cleanZipcide) NEQ 5) OR (Len(cleanZipcode) NEQ 9).

cleanZipcode = 5    F     OR    T
cleanZipcode = 9    T     OR   F
cleanZipcode = 7    T    OR   T

This statement is always true.

Try writing for the positive instead of the negative.
Happy Day!
Doug

----- Original Message -----
From: "David Baskin" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, May 15, 2001 2:20 PM
Subject: Strange problem (or still asleep)


> Hello, i'm running the code below and i'm not getting the expected
results.
> i'm passing in a variable with the length of 5 so i would expect that the
> errorString would not be appended, but in fact it is. The same thing
happens
> when i pass in a variable with the length of 9. I can't seem to figure out
> why this is happening. Can anyone help? Sorry if this is way basic.
>
> david
>
> code:
>
> script
> ....
> }else if((LEN(cleanZipcode) NEQ 5) OR (LEN(cleanZipcode) NEQ 9)){
>             errorString = ListAppend(errorString, "Please enter a valid
> zipcode (too long/short)", "|");
>             errorFlags = ListAppend(errorFlags, "zp", "|");
> ....
> /script
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to