I try to use functions and CFCs for code that may need to be included more than 
once, but I can think of a quick fix if you need to mimic an 'include_once' 
process:
at the bottom of your include code create a new unique variable.  at the top of 
the include code add a cfif not isdefined('[unique variable]') around the 
entire code.

This way if the code is run once that variable now exists and won't be run 
again.

For the Trimming, I usually use trim(form.[varname]) when I need to remove 
leading and trailing spaces

William

 
----------
William E. Seiter
ColdFusion Programmer / Web Developer

Free Website Trade Publication >> Website Magazine
Be sure to answer all of the questions on the subscription form, small price to 
pay for the loads of excellent content this magazine offers to Web 
Professionals for FREE!!

Have you ever read a book that changed your life?
Go to: www.winninginthemargins.com
Use PassKey: GoldenGrove
You'll be glad you did.

>I've got two questions.
>
>First: Is there a way to make sure a file is only cfincluded once?  I'm
>using cfinclude to include a UDF library in the onRequestStart() method of
>my application.cfc, but in my debug output, that file has a file count of 7,
>which has led me to realize that it's also being included when all of the
>other cfc and cfm files that go into the page are being called.
>
>Second: What method/code do you use to scrub/trim values in the FORM and URL
>scopes?
>
>Thanks
>
>Pete 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310057
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to