Any concerns with using global variables?

Hello!

I've noticed most people use local and instance variables in the macros they post here. I understand it keeps things clean, you don't have to worry about variable name conflicts between macros, and for security reasons, they go away once the macro is done running.

My issue is that I rely heavily on checking the status of my variables while I'm making a macro to debug things, so what I have tried doing is working with global variables while I'm building a macro, and then converting them to local variables once I'm finished. This works fine for small macros, but when a macro gets complicated, I end up breaking the macro going through and replacing all the variables.

Any tips on debugging while using local variables? Or should I just use global variables and not worry about it?

This is what I use for all my debugging:

YMMV

Thank you, I'll look that over!

Being a total newb, I just scatter "Display Text" actions everywhere!

4 Likes

:rofl: :rofl: :rofl: :joy: :joy:

Nige, we should revoke your privileges for typing this!
The Wonderful Wizard of Nige cracked a funny. :smile:

2 Likes

This macro I built some time back (and have been using a LOT since then) might interest you.

KMF: Redesigned: Convert Local Variables to Global Variables and Vice Versa

1 Like