1 Reply Latest reply: Jan 1, 2013 5:39 AM by Gysbert Wassenaar RSS

    How to run parametrized macro in trigger

      Hi All,

       

      I have two macro functions. One of them is parametrized.

      When I call the non-parametrized function from  'OnPostReload' action as macro everyting seems ok.

      But it is not working when I do the same for parametrized macro function.

      Macros are like following :

      -------------------------------------------------------------------------------------

      --------------------------------------------------------------------------------------

      function NonParametrized

      'do sth script

      end function

       

      function Parametrized (param1)

      'do sth script

      end function

      --------------------------------------------------------------------------------------

      --------------------------------------------------------------------------------------

      'following works in module, but that is not what I need

       

      function NonParametrized

      call Parametrized ("testParam1")

      'I want to do the same on OnPostReload's Edit Expression as macro (not in edit macro module, outside the macro module)

      'do sth script

      end function

       

      But when I write it OnPostReload  as Macro Name such as

      call Parametrized (param1)

      or

      Parametrized  param1

       

      It is not working.

       

      Any Idea ?

       

       

      Regards,

        • Re: How to run parametrized macro in trigger
          Gysbert Wassenaar

          You can call a sub but not a function in a macro. You won't get an error if you specificy the function name, but nothing will happen. So you have to call a sub. Use a variable to store your parameter and have the macro use the variable. If you want you can have the sub call the function and pass the value from the variable as parameter to the function.