Restarting within this macro

What is the right way to restart (Execute anew) a macro within this macro?

Thanks,
–Alain

I am not sure I understand what you want to do.
But the is the Execute Macro action you could use.

Thanks Jimmy for your answer.

I have a quite heavy macro which interactively change (or not) important data. If change occurs I have to restart this macro to process updated data.

My question is just if in a macro Heavy1 I can use Execute Macro Heavy1 without any care (thinking about reentrance ;-))?

–Alain

You can start the same macro in an Execute Marco action, but if it works as you suspect depends a lot on what your macro does.
If variables are used the could be set to a value you do not want them to.

The best way to restart a macro is to use a until/while loop, like this:

  • Set Made Change to 0
  • Until
    • Actions that might set Made Change to 1
  • Until Made Change is 0

Sometimes that is not so easy to do, so the best alternative to restart the macro is:

  • Execute Macro “This Macro” Asynchronously
  • Cancel This Macro

By executing the macro asynchronously, it will go off and run on its own, and the first instance of the macro wont pointlessly wait around for the second instance to finish.

1 Like

Thank you Peter clarifing KM internal and pointing out asynchronous execution (need perfect mastering of (global) variables use :wink: ).

–Alain