Search code examples
vb.netcomments

Break a comment at a single line of code in vb.NET


Here's a basic one:

Is it possible to break a comment to allow you to continue to write the code at the very same line in vb.NET?

I'm asking because there's a section in my code that I would like to comment the code before the code itself (line by line):

'Comment here    <code>

instead of

<code>    'Comment here

I know we can use the tag Rem to initialize a comment instead of ', but I don't know if it's possible to break the Rem (or the ') to continue to write the code.

Please, I know that some of you will point out the badness of this kind of procedure. But I would like to know how to do it anyway...

Thanks


Solution

  • No, you cannot have code after a comment on the same line.

    The documentation states:

    Comments can follow a statement on the same line, or occupy an entire line.

    To have a comment precede code, place the comment on the preceding line.