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
 Complex macros confuse VA
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tjcbs
Tomato Guru

104 Posts

Posted - Jul 09 2015 :  04:07:09 AM  Show Profile  Reply with Quote
I wrote a macro I use to perform an action every given time interval:

#define DO_ONLY_EVERY_SEC(every_sec) DO_ONLY_EVERY_SEC_LBL(every_sec, def)
#define DO_ONLY_EVERY_SEC_LBL(every_sec, lbl)             \   static float nextT##lbl  = 0.f;                        \   bool _bDo##lbl = (GetCurrentTime() > nextT##lbl);      \   if (_bDo##lbl)                                         \      nextT##lbl = GetCurrentTime() + every_sec;          \   if (_bDo##lbl)


This doesn't work well with VA; variables introduced inside the scope of the macro aren't recognized, and are often underlined.

For instance,
DO_ONLY_EVERY_SEC(1.f)
{
   static int test = 0; 
   tes         
}

Generates no suggestion box.

If I comment out the
DO_ONLY_EVERY_SEC(1.f)

then "test" is suggested when I type "t" or "te".

vs2013, VA 10.9.2068.0

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 10 2015 :  7:42:31 PM  Show Profile  Reply with Quote
Can you please try whether enabling recursive macro parsing helps:

http://docs.wholetomato.com/default.asp?W363
Go to Top of Page

tjcbs
Tomato Guru

104 Posts

Posted - Jul 15 2015 :  03:55:40 AM  Show Profile  Reply with Quote
This "fixes" it, a little. It is hard to give precise reproduction steps, but if you play with the example a little, you will see that even with the regedits it works only occasionally.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 15 2015 :  9:13:42 PM  Show Profile  Reply with Quote
Can you please revert your registry key settings and create a new file called va_stdafx.h next to your solution as a workaround? Please paste the following to this file:

#define DO_ONLY_EVERY_SEC(every_sec) DO_ONLY_EVERY_SEC_LBL(every_sec, def) \   static float nextT##lbl  = 0.f;                        \   bool _bDo##lbl = (GetCurrentTime() > nextT##lbl);      \   if (_bDo##lbl)                                         \      nextT##lbl = GetCurrentTime() + every_sec;          \   if (_bDo##lbl)
// comment to make sure there is an EOL after the last line

Trigger a symbol database rebuild:
VA Options -> Performance -> Rebuild

Edited by - accord on Jul 15 2015 9:15:16 PM
Go to Top of Page

tjcbs
Tomato Guru

104 Posts

Posted - Jul 21 2015 :  10:41:09 PM  Show Profile  Reply with Quote
I haven't tried this yet, but is there a bug number on this? This doesn't sound like a great workaround.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 22 2015 :  6:28:00 PM  Show Profile  Reply with Quote
I have investigated this and I was able to reproduce the problem here:

case=90999

Also, I have found an another workaround for this. I you use "No" for LimitMacro insead of "NoDepthLimit" (as described at the below link) the suggestion listbox works for me.
http://docs.wholetomato.com/default.asp?W363


Edited by - accord on Jul 22 2015 6:31:20 PM
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