Multiline comments? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Multiline comments?

vmfedorvmfedor Posts: 28Member
Hi, thanks for reading. :)

I've scoured the docs forever trying to find a way to do multiline comments in Visual Basic. If it doesn't have this feature, Microsoft is sure missing the boat, hahah. ;)

So, if anyone knows how to easily do multiline comments (example, "/*" and "*/" in C/C++ and it's variants), I would be more than grateful. :)

Thanks in advance,
Vince

Comments

  • DarQDarQ Posts: 1,625Member
    very very very easy. It can't be done in VB!! The only way is to use ' for each comment line.


    : Hi, thanks for reading. :)
    :
    : I've scoured the docs forever trying to find a way to do multiline comments in Visual Basic. If it doesn't have this feature, Microsoft is sure missing the boat, hahah. ;)
    :
    : So, if anyone knows how to easily do multiline comments (example, "/*" and "*/" in C/C++ and it's variants), I would be more than grateful. :)
    :
    : Thanks in advance,
    : Vince
    :

    [HR]
    Gadver, ik wot ha'k hjir no wr?
    [HR]

    [GREEN]Anyone cares to translate?[/GREEN]

  • infidelinfidel Posts: 2,900Member
    : Hi, thanks for reading. :)
    :
    : I've scoured the docs forever trying to find a way to do multiline comments in Visual Basic. If it doesn't have this feature, Microsoft is sure missing the boat, hahah. ;)
    :
    : So, if anyone knows how to easily do multiline comments (example, "/*" and "*/" in C/C++ and it's variants), I would be more than grateful. :)

    The only way to "fake" a multiline comment is to use line continuation marks ("_") at the end of comment lines:

    [code]
    Private Sub Form_Load()

    ' this is a multiline comment _
    to show that you have to use _
    silly tricks to accomplish _
    what should be inherent.

    End Sub
    [/code]

    It has to do with VB's interpreted nature, the compiler basically works with one line at a time. That's why VB notifies you of errors as soon as you hit Enter, where other languages require compilation to find errors.
  • vmfedorvmfedor Posts: 28Member
    Thanks guys. It's disappointing, but I guess I'll have to stick with commenting each line. :)

    Thanks again!
    Vince
  • DarQDarQ Posts: 1,625Member
    yo,

    congratulation for infidel for his very inventive way of solving this problem!! 100 points for you!:)

    : Thanks guys. It's disappointing, but I guess I'll have to stick with commenting each line. :)
    :
    : Thanks again!
    : Vince
    :

    [HR]
    Gadver, ik wot ha'k hjir no wr?
    [HR]

    [GREEN]Anyone cares to translate?[/GREEN]

  • infidelinfidel Posts: 2,900Member
    and the members of the academy.

    : yo,
    :
    : congratulation for infidel for his very inventive way of solving this problem!! 100 points for you!:)

    It's only a partial solution to the issue. It doesn't help at all if you're trying to, for example, comment out a particular block of code. I personally never use my example, I find that the block comment buttons are useful enough.
  • paulj59paulj59 Posts: 420Member
    You can select all of the lines and press the block comment button (or uncomment button)
    : and the members of the academy.
    :
    : : yo,
    : :
    : : congratulation for infidel for his very inventive way of solving this problem!! 100 points for you!:)
    :
    : It's only a partial solution to the issue. It doesn't help at all if you're trying to, for example, comment out a particular block of code. I personally never use my example, I find that the block comment buttons are useful enough.
    :

  • infidelinfidel Posts: 2,900Member
    : You can select all of the lines and press the block comment button (or uncomment button)

    Yeah, that's what I was talking about.
  • paulj59paulj59 Posts: 420Member
    : : You can select all of the lines and press the block comment button (or uncomment button)
    :
    : Yeah, that's what I was talking about.
    :
    Oh, so you did. Sorry.
Sign In or Register to comment.