> <CFIF NOT Len(Trim(Form.firstname))> doesn't work
>
> whereas <CFIF Len(Trim(Form.firstname)) GT 0> does work.
>
> Why?
>
> best,  paul

Try
<CFIF Trim(Form.firstname) IS NOT "">
"" is a sort of short-hand for string NULLs. It means "empty string".

True
<CFIF Len(Trim(Form.firstname)) GT 0>
will work, however it should be slower than the other. Why? The first
theoretically only has to test the first character (is it NULL or not?). The
one with len has to run through and count all the characters in the string.

I've never actually timed it in CF, mind you. But I've built string
functions in assembly before, and unless the Allaire programmer really
messed up their code, the first will always be faster, though a bit more
cryptic :)


--min



------------------------------------------------------------------------------
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