Need help to debug a simple custom macro

There is no really elegant way for this. You typically would “abuse” a macro to hold some “global variables” and use this construct to pass around values.
See Encoder runout will only pause when switching to T0, T1 and T2 runout does not trigger - #3 by Sineos for an example

1 Like