Macro1 overwriting Macro2's variables?

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Macro1 overwriting Macro2's variables?

Post by Snickers » Wed Aug 15, 2007 8:39 pm

If you have two compiled macros running on a single pc and both macros use the same variable names, will one of those programs be storing or overwriting the other macro's variables since each has identical variable names?

For example:

When notepad window opens, macro1 will GetWindowPos>notepad*,X,Y

at the same time while macro1 is still running, the user opens a second notepad and Macro2 will GetWindowPos>notepad*,X,Y


will the X and Y be overwritten?

I have tested this a few times with the above example and it is not overwriting them; however, I may be testing this incorrectly.

Is it possible to share variables between two different compiled macros?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Aug 15, 2007 8:55 pm

No, definitely not.

Two macros (whether compiled or not) are completely independent of each other and variables are specific to each. Neither knows about the other. A variable called X in macro A will not be confused with a variable called X in macro B.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Post by Snickers » Wed Aug 15, 2007 9:05 pm

I appreciate your rapid response. You guys are always on the ball!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts