PDA

View Full Version : syntax for asp comment


cburnett
01-04-2011, 06:33 PM
Hello

can an asp comment be closed with a ' ?

ex

Modified example... (original doesn't have closing ' and may be causing color coding error in DW cs4) .


<!--#include file="store/pc/include-metatags.asp"-->
<%
'default to order tab or not'
Dim tab1, tab5, switchtabs
switchtabs = Trim(request.querystring("o"))
if isnumeric(switchtabs) then
tab1="style='display:none'"
tab5="style='display:block'"
else
tab1="style='display:block'"
tab5="style='display:none'"
end if
%>


I ask because recently (last two months) DW CS4 has been rending code coloring off... when I removed this comment or modified it (it is the first thing on page) the color coding is accurate again.

I don't understand ASP and want a best practice and would prefer to keep the comment in line if possible.

thanks
casey

Old Pedant
01-07-2011, 06:20 AM
VBScript uses the apostrophe to start a comment and the end of the line ends the comment. A trailing apostrophe doesn't hurt, but it is not necessary.

I, personally, wouldn't trust DreamWeaver to wipe its nose, let alone get syntax coloring right. Quite possibly DrunkWalker thinks you are coding in JScript, in which case a comment line starts with //. So if DreadWaster had the wrong language, it would color things wrong. If the page works, ignore DoofusWhomper's colorings.