Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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,

1 Reply
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.


talk is cheap, supply exceeds demand