How can I put multiple-line comments in Visual Basic?
How can I put multiple-line comments in Visual Basic?
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)