btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2015
06:37 AM
Global Variable Not Available In Function
Why would be that a "m" variable would be available in one function and not another? I set a variable as global during a load sequence such as:
Later in code I have a large function that calls the m.guide and works perfect. I decide to cut the function up into smaller functions for debugging and modifications. I copied this section of the larger function and pasted into the smaller function. Nothing else changed, but when I call the smaller function I get error that variable is not Dim'd. Under the RunUserInterface I have declared the variable and populated it. Like I said, it is available in the original function. Just wondering if there is anything in general that may cause this.
Thanks
m.guide=guide
Later in code I have a large function that calls the m.guide and works perfect. I decide to cut the function up into smaller functions for debugging and modifications. I copied this section of the larger function and pasted into the smaller function. Nothing else changed, but when I call the smaller function I get error that variable is not Dim'd. Under the RunUserInterface I have declared the variable and populated it. Like I said, it is available in the original function. Just wondering if there is anything in general that may cause this.
Thanks
1 REPLY 1

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2015
07:48 AM
Re: Global Variable Not Available In Function
If you call a function through an AA, "m" in that function refers to the AA, not to the global m. In such a function you can use GetGlobalAA to get the global m.
--Mark
--Mark