ASP Comments - Comment Out Code in ASP

Just to point out to those beginners that using an apostrophe at the start of a line or anywhere in a line of ASP code comments out that code. It will not be processed.

The reason I am telling you this is that I spent many's an hour looking at other peoples code thinking what the f*** is that ' for.

Commenting comes in handy because when you come back to look at your code whether 2 weeks or 3 months later, you invariably have difficulty reading and understanding it especially if it is complicated. So if its difficult for you, remember that commenting could also help others who have the misfortune of having to rewrite your code.

<%
'This is a comment, below I will write out my name
response.write "Michael Wall"
%>

Or this

<%
response.write "Michael Wall"    ' This will write out my name Michael Wall
'note that the apostrophe above didn't start on a new line and it doesn't have too
%>

You will also come across fancy ways that people write comments, they all just do the same thing. ie. the apostrophe is all that is needed.

<%
'###### This code Belongs to Michael Wall ##########
'======Script Title HERE=======

%>

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Get your best asp web hosting provider now and save 25%