Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Complex macros confuse VA

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
tjcbs Posted - Jul 09 2015 : 04:07:09 AM
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
5   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jul 22 2015 : 6:28:00 PM
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

tjcbs Posted - Jul 21 2015 : 10:41:09 PM
I haven't tried this yet, but is there a bug number on this? This doesn't sound like a great workaround.
accord Posted - Jul 15 2015 : 9:13:42 PM
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
tjcbs Posted - Jul 15 2015 : 03:55:40 AM
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.
accord Posted - Jul 10 2015 : 7:42:31 PM
Can you please try whether enabling recursive macro parsing helps:

http://docs.wholetomato.com/default.asp?W363

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000