Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 FindSymbol_cann't find the macro-symboy in func
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jzq740176597
Tomato Guru

China
346 Posts

Posted - Nov 02 2012 :  12:48:58 AM  Show Profile  Reply with Quote




VA versoin_1916
As metioned above, in a cpp file ,in a function,I use FindSymbol function,Even I type all the macro name. It still cann't give me the Symbol.
Is bug?

Creation come from persist!

feline
Whole Tomato Software

United Kingdom
19177 Posts

Posted - Nov 02 2012 :  3:24:03 PM  Show Profile  Reply with Quote
This is by design, since the macro is within a function. If we expose every symbol that is local to a function then we are going to get swamped by these local symbols.

Since you are only using the macro inside the function, why not simply replace it with a const int?

zen is the art of being at one with the two'ness
Go to Top of Page

jzq740176597
Tomato Guru

China
346 Posts

Posted - Nov 04 2012 :  12:43:47 AM  Show Profile  Reply with Quote
Got it,By the way, I Found the macro is within a function is not really local to the function,it also can be used under the file.It's the C++ specification design?

Creation come from persist!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19177 Posts

Posted - Nov 05 2012 :  12:33:55 PM  Show Profile  Reply with Quote
The pre-processor expands the macro, and as far as I know the pre-processor is not scope aware, so it makes sense that the macro is used outside of the function it is declared in.

However this is not the way normal scope rules work. A good example of why dealing with macros can sometimes be a little bit tricky for VA

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000