Not sure what you mean by a block comment, but if you want to label a code
section, you could comment a blank line above the code, then comment a blank
line after.
eg
'Comment here
Code starts here
-
-
-
-
-
Code ends here
'-----------
What I mean by a block comment is in Transact-SQL (SQL Server 2000) and Java, a block comment starts with /* and ends with */.
Everything in between the start of the comment and the end of the comment is commented out, whether it consists of multiple lines or
just a couple of characters on one line. That way, when working with multiple lines, you don't have to comment out each line
individually. You just need to put a /* at the beginning of the lines you want commented out and put */ at the end.
Nope... Each line of comments must start with an apostrophe. C/C++ does not
care about carriage returns in the code so you can comment entire sections.
Here is what you can do. In the VBE bring up the edit tool bar and there are
two buttons on the bar "Comment Block" and "Uncomment Block". Select a group
of code and hit the button to automatically comment the entire section.
I already know about the Comment and Uncomment buttons on the toolbar. I use them quite regularly.
I was just hoping that VBA had a Start Comment character and an End Comment character, because they might be valuable in another
way. I would not use them to comment out multiple whole lines, but I think they might be useful to comment out sections of a single
line.
Sorry the languages you list (of which C/C++ is a part) are all freeform
languages. They don't care about carriage returns or comments. They care
about semi colons.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.