Announcement

Collapse
No announcement yet.

dynamically call of a function not working ??

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • dynamically call of a function not working ??

    This is working :
    $myFunc = B01();


    This is not working .. why ??
    $etab_be = "B01"
    $myFunc = $etab_be();

    error :Call to undefined function B01()

    But this should work or not ??

    Best regards
    Uwe

  • #2
    The way correct is:

    $sql = "select myfunction()";
    sc_lookup(dataset,$sql);

    $myvalue = {dataset[0][0]};

    Comment


    • #3
      Originally posted by alvagar View Post
      The way correct is:
      I do not think ...

      Originally posted by alvagar View Post
      $sql = "select myfunction()";
      sc_lookup(dataset,$sql);
      function myfunction()
      return "* FROM <mytable>";

      $sql = "select myfunction()";
      sc_lookup(dataset,$sql);

      => Error: Undefined property: blank_apl::$myfunction

      Which is also entirely correct ...

      Originally posted by alvagar View Post
      $myvalue = {dataset[0][0]};
      Please: $myvalue = {dataset}[0][0]; ...
      Last edited by RHS; 08-18-2013, 01:18 PM.
      Best regards: - Reinhard -

      I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

      Comment


      • #4
        Helo,
        my question has noting to do with a sql select statement....
        it's only a dynamically call of a function using a variable...

        Best regards
        Uwe Pfeiffer

        Comment


        • #5
          Originally posted by Pfeiffer View Post
          it's only a dynamically call of a function using a variable...
          Yes, but that is not working ..
          Best regards: - Reinhard -

          I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

          Comment


          • #6
            Is a function php? or from a database?

            Comment


            • #7
              if is php here a link: http://stackoverflow.com/questions/4...on-dynamically

              Comment


              • #8
                Hello Uwe,
                you must use the php function call_user_func

                Here is an example when I understand your question correct:

                function B01 ($type) {
                print "$type";
                }


                $etab_be = "B01";
                $myFunc = call_user_func ($etab_be, "my Variable Value");

                I hope I can help you.
                Best regards: - Simon -

                Comment

                Working...
                X