Is there a way to comment a block of code, besides manually going to each line and ' ing it for each line? I mean, if C++ and Java have it, Visual Basic should have it too! :)
-Jordan
Printable View
Is there a way to comment a block of code, besides manually going to each line and ' ing it for each line? I mean, if C++ and Java have it, Visual Basic should have it too! :)
-Jordan
Not that I know of. I slightly checked one time and never found out how.
1. Right click on your toobar and check Edit
2. Select your block of codes to comment
3. From the new set of toolbars, click on Comment Block
Note:
Other handy editing tools are provided as well as form editor tools.
hope this help.
There is a way, I found it in the MSDN library
1. Your right click (in the toolbar area) and click on the EDIT toolbar
2. there are 2 buttons there. They have aqua blue lines in them. so you highlight the text that you want to comment then you click the left button and it automaticly adds the ' infront of very line, then the second button (to the right of it) un comments the code
Good stuff. That toolbar is now docked to my other ones...
Thanks.. too bad there's no syntax to do it manually (I personally hate using the mouse for anything)
you can do what I do sometimes:
Arrow Down
Arrow Left
'
Arrow Down
Arrow Left
'
etc....
arrow down
arrow home
that's what I do, quick enough...
tell you'll have to strech your fingers to get both keys rapidly as where the arrows you can use your middle finger and index
Oh, I'm using the numeral keypad to move around. I know it's not a good habit, but since my early commodore 64 years I used it that way =)
That's why I use 'Home'.
why isn't it a good habit
I'm not saying its a good habit, but its just not a bad habit, its just a prefrence
I called it a bad habit since it often happens that someone uses my computer after me and they try using the numeral keypad as it's meant to be used: for typing numbers.
I often find myself more comfortable using that pad to type numbers so I have to toggle the Num Lock all the time.
For me it's a bad habit =) Arrows should work just fine... although it's nice to have the pgup, pgdn, home and end near.
dimava, I meant there's no actual syntax to comment big chunks of code ala Java: /*
Highlighting the text and clicking a toolbar button just to comment code is just too much work!! :)
...thought I was lazy...
Actually there is a Syntactical way, place the apostrophe at the beginning of the block, then at the end of each line add a space and an underscore, i.e. [CODE]Private Sub Form_Load()
'Commented Block of Code _
See This 2nd Line is Commented too!
End Sub[CODE]