I call a function through object at runtime. In this specific case, the function name is supplied through a logic from another page at runtime (the function exists in cfc). At present we use Evaluate and that is very slow. Any way I can get rid of this? I know I can use [] with a structure but here I am lost. qryData is the query object which I pass to the function.
<cfset someData = Evaluate("objTicket.#arrayItem[ItemID].FunctionName#(qryData)")>
<!---this is how it would look like--->
<cfset someData = objTicket.getTickets(qryData)>
Does this fix it for you?
<cfset someData = objTicket[arrayItem[ItemID].FunctionName](qryData)>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With