On Friday, Mar 28, 2003, at 10:59 US/Pacific, S. Isaac Dealey wrote:
> <cffunction name="getValue" ouptut="false">
>   <cfargument name="propertyname" type="string" required="true">
>
>   <cfif isdefined("this.get_" & propertyname)>
>     <cfreturn evaluate("this.get_#propertyname#()")>
>   <cfelse>
>     <cfreturn this[propertyname]>
>   </cfif>
> </cffunction>

Eek! Evaluate! :)

Try this instead:

<cffunction name="getValue" ouptut="false">
   <cfargument name="propertyname" type="string" required="true">
   <cfset var fn = 0>
   <cfif structKeyExists(this,"get_" & propertyname)>
     <cfset fn = this["get_" & propertyname]>
     <cfreturn fn()>
   <cfelse>
     <cfreturn this[propertyname]>
   </cfif>
</cffunction>

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to