Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
obouillaud #1
[cfc] A way to test a if a function exists ?
Hi I want to do the following thing : <cffunction name='set' access='remote'
output='no'> <cfargument name='name' type='string' required='yes' >
<cfargument name='value' type='any' required='yes'> <cfif IsDefined(
set_#name#() ) is false> <CFSET 'THIS.#name#' = arguments.value> <cfelse>
<CFSET 'THIS.#name#' = set_#name#(#value#)> </cfif> </cffunction> The
goal is to avoid many set_id(), set_title(), ... methods that are just doing
this.name = arguments.value BUT keeping a way to add a custom function if a day
I need a method to be more specific. Imagine a set(price,12) function that
basically set this.price to 12 The day I need to add an internal conversion
(changing currency for example) I just have to add a set_price() function with
custom code, and everything still works well. How can I do that ? The bonus
is to keep the possibility to have more than one argument : if one day my
set_price() function needs a value AND a currency ('dollar', 'euro' ...) I
still want my set() function to work. What should I do ?
obouillaud Guest
-
File/Directory NOT Exists Test Fails
Hi, I am migrating clients to a new server and Cont 3 is throwing this(See below) up during the connection and so the connection is failing. Does... -
method name exists, property value exists, calling method fails
I have a class object I am calling in another class: class Stuff { var $myObj; function Stuff($myObj) { $this->myObj = $myObj; } -
Test::Unit -- multiple errors in test method ???
Hi ! I have been writing some unit tests with Test::Unit. I've noted that when an assertion fails in a test method, the remaining assertions... -
Function to test alphanumeric
Anyone have a function or method (that could be converted to a function) whereby one could test or check a CHAR or VARCHAR column so that it... -
note 33827 added to function.function-exists
This can be used to conditionally define a user function. In this sense, it can act as a sort of inline include_once(). For example, suppose you...



Reply With Quote

