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. |
|
|