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
 VAX can't find local variables in macroses
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AGL
New Member

Russia
8 Posts

Posted - Mar 01 2006 :  12:57:48 AM  Show Profile  Reply with Quote
Hi
I'm using VAX 1440 under VS6
There are still stable error in VAX, it can't correctly parse macroses with declarations of variables.

Check following example:
#define DR int ii; double dd;
void main(){
DR;
ii=0; dd=0.0;
}

VAX can't tell where was "ii" and "dd" defined.

support
Whole Tomato Software

5566 Posts

Posted - Mar 01 2006 :  7:55:58 PM  Show Profile  Reply with Quote
VA X is behaving this way by design. Your example is a bit unusual. More likely, you'd have:

#define BIGINT int
BIGINT foo;

When you click foo, you want to see BIGINT as the definition of foo, not int. (Remember, VA X is trying to help while editing; it's not compiling.)

Macros #defined using ()'s do get resolved one level when used in definitions. This is done for several reasons, and one applies to your example. If you want VA X to resolve a macro used in a definition, include parens with it.

#define BIGINT() int
BIGINT() foo;

Click on foo and you see int.

The resolving of macros one level during edit is done by default and in most cases, causes VA X to understand variable definitions to the extent you want.

In your case, try:

#define DR() int ii; double dd;
DR();
ii=0;

VA X will know what ii is.

If you have a more complex example, post it and we might suggest a better workaround. (Some hacks are done via our stdafx.h.)
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