Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Add a statement to print the current variable

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
fspafford Posted - Nov 19 2016 : 7:15:44 PM
Is there any feature in Visual Assist that would allow me to add a print statement to print the current variable by adding a print statement to the C++ source file?

For example, take this line"

nCount = x + 1;

If I put the cursor over nCount, I want to add a statement after the line like:

trace("nCount %d", nCount);

Regards,

Frank
2   L A T E S T    R E P L I E S    (Newest First)
ChrisG Posted - Nov 22 2016 : 12:46:25 PM
Also, here is a great way to add that snippet to your copy of Visual Assist.

First, copy the xml below into your clipboard.

<VA_Snippet>
<Language>C++</Language>
<Title>Trace</Title>
<Shortcut>t</Shortcut>
<Description>Trace the variable currently in the clipboard.
</Description>
<Code>trace("$clipboard$ %d", $clipboard$);</Code>
</VA_Snippet>

Then, open the VA Snippet Editor, and paste the code in using [Ctrl-V].
ChrisG Posted - Nov 19 2016 : 8:47:52 PM
Hi fspafford,

You could create a new VA Snippet similar to the one shown in the attached screenshot.

To use it, you would need to have the name of the variable you wish to trace copied to your clipboard. Then, you can just move your cursor to where you want the trace to go in your cpp file and press 't', then 'tab' to create the snippet.



Since we don't support mouse hover as input for a VA Snippet, it's not exactly what you're asking for. It will be interesting to see if the developer of the feature has considered mouse hover being used as input before! I like the idea and will mention it to him.

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