I done it once or twice before, I think the following would work (If my memory serves me well):

<cfset result = evaluate("Validation." & dynamicFunctionName & "(argumentVar)")>

Anyways if above doesn't work, there is a solution, you just have to play around with it as I do remember doing above in CFMX.

TK
  ----- Original Message -----
  From: Bryan Stevenson
  To: CF-Talk
  Sent: Tuesday, October 28, 2003 11:24 AM
  Subject: Dynamic CFCs

  Hey All,

  OK...I've dynamically named variables many many times before, but now I'm
  trying to figure out if it's doable with CFCs.

  The scenario:

  This is postal/zip code validation and I want to use the appropriate
  function depending on the user's country.  So I want to call my "validation"
  CFC with the name of the function being dynamic (i.e.
  Validation.dynamicFunctionName(argumentVar)).  The problem I'm having is the
  argument.  It doesn't need to be evaluated, but the "dynamicFunctionName"
  does.

  Hope that made some sense....if it's possible to do this like it is with
  dynamic vars....a code sample would be lovely ;-)

  TIA

  Cheers

  Bryan Stevenson B.Comm.
  VP & Director of E-Commerce Development
  Electric Edge Systems Group Inc.
  t. 250.920.8830
  e. [EMAIL PROTECTED]

  ---------------------------------------------------------
  Macromedia Associate Partner
  www.macromedia.com
  ---------------------------------------------------------
  Vancouver Island ColdFusion Users Group
  Founder & Director
  www.cfug-vancouverisland.com


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to