Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Optional comment on end of

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
Sasa Posted - Jan 19 2006 : 12:46:10 PM
This suggestion is very neat and could well be a good feature as an "autoinsert end of block comments" feature for VAX :)

Taken from codeproject:

Have you ever wrote a bunch of code which looked like this:



Ok, I admit this isn't a very good style of programming, but sometimes it can't be avoided. And in those cases the code is horrible to read because you don't know which closing brace belongs to which opening statement without scrolling or using the macro 'Edit.GotoBrace' several times. VAX should provide a auto function which inserts comments after the closing brace automatically.



Comments are only inserted for closing braces of if, while, for and switch statements { configurable by user }.

If you don't want to insert comments automatically while editing, you can turn off this function. If you just don't want those comments at specific places you have to move the caret either upwards (instead of downwards which happens if you press enter) or click with the mouse so that the caret doesn't go to the line below the closing brace. Comments are also not inserted when the opening brace is less than two lines above { configurable by user }.

Tell me what you think.
5   L A T E S T    R E P L I E S    (Newest First)
sl@sh Posted - Sep 17 2007 : 05:12:07 AM
You could just modify the
if (...){
   //...
}

autotext entry to
if (...){
   //...
} // if


Same for other keywords like do, while, for, switch, etc.. You might also adapt else blocks in this manner. You still won't be able to discern several levels of for loops or if statements, but it might still be helpful
Old as dirt Posted - Sep 14 2007 : 1:31:40 PM
What I've done doesn't involve VA but rather the macro recorder.
I go to the ending brace and start the macro recorder then press CTRL-} to get to the opening brace then press SHIFT-Home to highlight from the beginning of the line to the opening brace. Then press CRTL-C to copy that to the clipboard. then press the right arror key which takes the cursor back to the opening brace. Then press CRTL-} again to get back to the ending brace. Then press the right arrow key to get behind the closing brace. Then I type a space or tab and // end and then press CTRL-V to past what this is the end of. Then I stop the recorder and after that you just press CTRL-SHIFT-P to play back the macro. I have to first go to the starting brace to make sure it is something that this will work on. I don't work with macros enough to know how to assign a different hot key so that I could have more than one of these recorded macros. That is fortunate bacause I've never needed to record but just this one.
support Posted - Jan 19 2006 : 8:16:47 PM
We have considered the feature but opt not to implement it. Instead, we put "if" and the like in the Content field of our wizard bar, and we support jumping to an opening brace from anywhere within a pair. Try Alt+Up Arrow.

http://www.wholetomato.com/products/features/move.html?more=yes
Sasa Posted - Jan 19 2006 : 2:25:03 PM
quote:
this leads to the idea of VA having to "jump in" as you move past an end bracket, or having a keyboard shortcut / toolbar button to trigger the insertion of the comment.

This is what I have thought too. I mean VAX already detects tokens while editing like the ".", "->", etc...

I though of something of the like:
-detect closed curly bracket ( maybe on enter keypress after a closed bracket?)
-see if matching open bracket is an if, while, for, switch ( or user configurable )
-if true
-Appendranch statement ( if( i == x ), etc...) as comment to the end of the close bracket

Seems straight forward enough, at least on paper.

I cannot install Kingstool because I only have VS2005 currently on my system.
feline Posted - Jan 19 2006 : 1:57:05 PM
i thought i recognised it, this is from the tool:

http://www.codeproject.com/macro/kingstools.asp

the primary problem with this is how it would fit into the existing way VA works. look at the autotext rules that insert for() blocks, while() blocks, etc. when the block is inserted you do not have a complete for or while like with which to produce a comment.

this leads to the idea of VA having to "jump in" as you move past an end bracket, or having a keyboard shortcut / toolbar button to trigger the insertion of the comment.

never having used this feature, how does kingstools get around this problem?

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