2 Replies Latest reply on Dec 1, 2006 6:44 AM by BigRJJJ

    Questions - dereferenced Function Call, form capitalization

    BigRJJJ
      Hey two quick questions.

      I'm wondering if I can call a com object function given that I have the string instead of the function name.

      ie. Instead of
      MyComObject.fucntionName(parameter);

      something like this

      stringVariable = functionName
      MyComObject.stringVariable(parameter);

      I know the syntax is incorrect but does anyone know how to do this in coldfusion?

      QUESTION #2 :
      I'm doing something like the following,
      for (keyName in FORM) {
      if (FORM[keyName] IS NOT "")
      {
      WriteOutput("FORM." & Keyname & " has the value: " & FORM[keyName] &"<br>");
      }
      }

      However all the Keynames come out capitalized.
        • 1. Re: Questions - dereferenced Function Call, form capitalization
          MikerRoo Level 1
          quote:

          Originally posted by: BigRJJJ
          Hey two quick questions. ... ...

          However all the Keynames come out capitalized.


          These are not really quick questions. Suggest you repost question 1 on another thread and provide details of the COM function and which CF version you are using.

          As for CF uppercasing all the names of form fields, that's a "feature"! ;-)

          If you want the original case, then you need to process the raw post for that.
          See the attached code.

          • 2. Re: Questions - dereferenced Function Call, form capitalization
            BigRJJJ Level 1
            sweet I'll try asking the question again with some more information.

            I think it's not that difficult, in php it would look like this.

            instead of this
            $comObject->functionName(parameter);

            this

            $functionNameVariable = "functionName";
            $comObject->$functionNameVariable(parameter);

            I want to do something similar in CF but so far have been completely unable to see any way of doing this. Who knows, maybe CF doesn't support this. I am using cold fusion MX7.