>> function isEmpty(mystring) { return yesnoformat(not
> len(trim(mystring))); }
>>
>> function isNotEmpty(mystring) { return yesnoformat(len(trim(mystring)));
>> }

<snippage>

> Of course, you're breaking the Numeric vs Boolean rule with this
> function....

> Yes yes... yesnoformat accepts a boolean or a number and non-zero numbers
> are treated as true, but that's only because thats what CF does anyway....

> Why on earth are you using a function for this at all?  So <cfif
> IsEmpty(mystring)>  reads nicer, but whats wrong with just checking to see
> if the length is greater than zero?

I don't actually use them -- I was just commenting on the thread -- the
couple functions I saw in previous messages were longer and imho more
difficult to read. I don't necessarily see anything wrong with using them
for the purpose of encapsulating the len(trim()) and "cleaning up" the rest
of the application... but I don't personally have any use for them... I find
<cfif len(trim(myvar))> plenty easy to code and read.

I've seen peole use stuff like <cfif myvar is "yes"> which i dislike because
someone might make the value of myvar "true" in which case it should
evaluate true but will evaluate false because "true" isn't "yes".


S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to