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
 try/catch macros confuses VA
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rogerio.ramos
New Member

USA
9 Posts

Posted - Sep 16 2013 :  2:47:03 PM  Show Profile  Reply with Quote
I could narrow down to a simple repro listed below. See [1].
In this example, the variable fence in the expression "fence = fence + 1" in the CATCH block and the other same expression after CATCH_END is marked as not recognized.

If I replace TRY2 by TRY in the tmain code then it will work fine.

Let me know if it repro'es for you.

Thanks,

Rog+?rio Ramos
Microsoft

[1]

#include "stdafx.h"

#define TRY \	try {

#define TRY2	TRY

#define CATCH \	} \	catch (...) \	{

#define CATCH_END \	}

int _tmain(int argc, _TCHAR* argv[])
{
	int fence = 0;

	TRY2
	{
		fence = fence + 1; // recognized
	}
	CATCH
	{
		fence = fence + 1; // Not recognized
	}
	CATCH_END

	fence = fence + 1; // Not recognized

	return 0;
}

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 17 2013 :  2:47:54 PM  Show Profile  Reply with Quote
I was able to reproduce the problem here. However, since this is a recursive macro parsing I tried enabling the appropriate setting, and it helped for me:
http://docs.wholetomato.com?W363

This is disabled by default for performance reasons.
Go to Top of Page

rogerio.ramos
New Member

USA
9 Posts

Posted - Sep 17 2013 :  4:42:29 PM  Show Profile  Reply with Quote
That indeed helps. Actually the alternative solution to use the VA stdafx.h with simplified versions of the macros worked even better.

Thanks for pointing me those.

Rog+?rio
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 18 2013 :  9:19:06 PM  Show Profile  Reply with Quote
I'm glad it helped. If you use simplified macros without recursion, you don't even need to keep the recursive parsing on. In fact it is advised to turn it off when using the simplified macros.
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