0

How can I comment a selected block in vbscript using Visual Web Developer 2010 Express?

Updated : I meant selecting a block and commenting every line. If I do it in Visual Studio Web Developer 2010 the comment created is for html, not for vbscript.

Jenninha
  • 1,357
  • 2
  • 20
  • 42

4 Answers4

0

use '

   <script type="text/vbscript">
    Dim myMessage
    'myMessage = "I am having a great day!"
    myMessage = "I could use a nap..."

    'This will print out myMessage to the visitor
    document.write(myMessage)

    </script>
Sudantha
  • 15,684
  • 43
  • 105
  • 161
  • Sorry, I meant selecting a block and commenting every line. If I do it in Visual Studio Web Developer 2010 the comment created is for html, not for vbscript. – Jenninha Jul 12 '12 at 10:54
0

VBScript only has support for single-line comments.

Example:

Dim myMessage
'myMessage = "I am having a great day!"
myMessage = "I could use a nap..."

'This will print out myMessage to the visitor
document.write(myMessage)
0

I was using my code between <% %> only and VS commented my selection as html, but if I use my code in between <script language="vbscript"> </script> and comment selection it works, it comments as vbscript code.

Jenninha
  • 1,357
  • 2
  • 20
  • 42
0

Copy it to Notepad ++ Ctrl+H to open Replace. Replace \r\n to \r\n' in Extended Search Mode all lines will be commented with single line comment char '.

Davut Gürbüz
  • 5,526
  • 4
  • 47
  • 83