Multiple Line Comments in Visual Basic

1

How can I put multiple-line comments in Visual Basic?

    
asked by anonymous 30.05.2015 / 23:54

1 answer

2

Unfortunately, there is no way to create a multi-line comment in BASIC, but there are some "tricks" we can do:

Trick 1: #If

You can try creating #If blocks with non-existent expressions, so the compiler will ignore the block. Example:

#If Comentario Then
     Isso é
     um comentário
     de várias linhas
#End If

Trick 2: REM

The same thing as the 'character, you can define as in the example:

REM linha 1
REM linha 2
REM linha 3

Trick 3: Ctrl + K, Ctrl + C (Visual Studio 2008 + only)

This is simple, just enter the code, select what you want to comment and press Ctrl + K (Visual Studio 2008 + only)

    
30.05.2015 / 23:54