|
-
Feb 19th, 2004, 05:06 PM
#1
Thread Starter
Fanatic Member
Multi line comments...
Hmm, I was wondering if there is a way in VB to use multiline comments. You can comment your code by putting this ' or REM in front of a line, but if you want more than one line commented you have to add them to every line apart... 
Is there a way to use multiline comments in VB? E.g. in Java it's done like this:
Code:
*/Comment
Another comment
Yet another/*
Don't tell me MS didn't implement this...
Author for Visual Basic Web Magazine
-
Feb 19th, 2004, 05:16 PM
#2
There is no way that I am aware of. I tried the C-style comment /*....*/, but it didn't work.
-
Feb 19th, 2004, 05:17 PM
#3
Try adding a line continuation.
VB Code:
'This is a _
multiline comment
Its the best you are going to be able to do.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 19th, 2004, 05:26 PM
#4
All in all, it is a pretty trivial issue because there is no line wrap to speak of. I like to have all the comments visible without scrolling. However, when I write on a large screen, the comments can be pretty long, but once I move to a small screen, they overrun the width of the page. Thus whether I use one awkward comment designator at beginning and end, or one easy one per line, it really doesn't much matter. Either way isn't the best.
-
Feb 19th, 2004, 05:26 PM
#5
Thread Starter
Fanatic Member
Originally posted by crptcblade
Try adding a line continuation.
VB Code:
'This is a _
multiline comment
Its the best you are going to be able to do.
Doesn't work... looks like MS didn't implement it...
Author for Visual Basic Web Magazine
-
Feb 19th, 2004, 05:28 PM
#6
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 19th, 2004, 05:28 PM
#7
Thread Starter
Fanatic Member
Originally posted by Shaggy Hiker
All in all, it is a pretty trivial issue because there is no line wrap to speak of. I like to have all the comments visible without scrolling. However, when I write on a large screen, the comments can be pretty long, but once I move to a small screen, they overrun the width of the page. Thus whether I use one awkward comment designator at beginning and end, or one easy one per line, it really doesn't much matter. Either way isn't the best.
You got a point, but what I'm actually trying to do is comment out some code because it doesn't work yet and it screws up the part that should work. But I'm not gonna take the hassle of putting REM before each line... guess I'll have to cut it to the clipboard...
Author for Visual Basic Web Magazine
-
Feb 19th, 2004, 05:30 PM
#8
the _ is exactly the way to go
VB Code:
[color=green]' a multi line comment _[/color]
[color=green]by dynamic sysop _[/color]
[color=green]the end ...[/color]
[color=blue]Private[/color] Const Testing = 123
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Feb 19th, 2004, 05:30 PM
#9
Thread Starter
Fanatic Member
Originally posted by crptcblade
Works fine for me.
You're right, it does. I forgot to add the space between the 'a' and the '_'. But even then, you'll have to add it to every line separately.
Author for Visual Basic Web Magazine
-
Feb 19th, 2004, 05:30 PM
#10
Originally posted by TheVader
You got a point, but what I'm actually trying to do is comment out some code because it doesn't work yet and it screws up the part that should work. But I'm not gonna take the hassle of putting REM before each line... guess I'll have to cut it to the clipboard...
Just use Block Comment/Uncomment on the Edit toolbar.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 19th, 2004, 05:34 PM
#11
Thread Starter
Fanatic Member
Originally posted by crptcblade
Just use Block Comment/Uncomment on the Edit toolbar.
Never knew of that option. Thanks.
Author for Visual Basic Web Magazine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|