ASP Q&A: Commenting Blocks in VBScript

WEBINAR: On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >

This is the third in a series of tips being posted based on the most read posts in one of our ASP Forums. (previous Q&A)

Problem / Question:

How can a whole block of VBScript be commented out?

Solution:

Unfortunately, you cannot block comment VBScript like you can in other languages. You can comment out each line individually. Just put a single quotation mark at the start of the line you want to 'out' and do then do the same for each subsequent line.

The following shows a sample code listing with a block of code commented:

Dim a, iLen, bSpace, tmpX, tmpFull
 
iLen = Len(sText)
  For a = 1 To iLen
'    If a <> 1 Then 
'        If bSpace = True Then 
'            tmpX = UCase(mid(sText,a,1)) 
'            bSpace = False 
'        Else
'        tmpX=LCase(mid(sText,a,1))
'            If tmpX = " " Or tmpX = "'" Then bSpace = True
'        End if 
'    Else
'        tmpX = UCase(mid(sText,a,1))
'    End if 
tmpFull = tmpFull & tmpX Next ProperCase = tmpFull End Function

Based on posts by forum members Lydia, Scotty, and Xanderno



Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date