In vb we put comments in codes using single quote in front of comment without close it at the end of comments. Ex : 'This Will be a comments
But something wrong if i don't close it with single quote too. All codes after comments will become like comments until i close it with single quote.

This is a try :

'This is a comments
Dim i as Integer ' declare i as integer type
Dim j as String

For i = 0 to 5 ' This comments too
   Msgbox i 
Next i

It makes me must to close my comments with single quote if i want to post the codes in VB section.

'This is a comments'
Dim i as Integer ' declare i as integer type'
Dim j as String

For i = 0 to 5 ' This comments too'
   Msgbox i 
Next i

Thank You.

Recommended Answers

All 6 Replies

Testing ...

'This is a comments
Dim i as Integer ' declare i as integer type
Dim j as String

For i = 0 to 5 ' This comments too
   Msgbox i 
Next i

Hold on ... having a huge bug right now where no one can post! ...

Ok ... my apologies.

There is another way of doing code tags without indenting. Code blocks start and end with three tildes in a row, and allow you to force a specific language to be used. Therefore, you can do:

~~~ vb
Here is VB code that I am forcing to be syntax highlighted with VB syntax
~~~~

And that should work.

And that should be the action of the Code button, right? Like before code tags and cursor between for pasting, now in line between tildelines:

This will be empty line with cursor

There will be ready new lines ie tags are '\n~~~\n'. I think it would be good change, if somebody want to tabulate let's paint and push tab (even you would be afraid that the tab replace the text from Word experience, not indent like programmers editor)

Consider to do soon this change of Code button update as posting in Python forum is a mess with code tags. (you could add forum default syntax after first tildes to get vb syntax in vb forum)

Consider to do soon this change of Code button update as posting in Python forum is a mess with code tags.

I'm confused. What's wrong with the Python forum?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.