In-code comments


#1

Whilst I’m a newby to Lucee I have done a fair bit of Coldfusion but not with webpages, more with Flash. Anyway, I’m doing lots of experimentation to learn the webapps side and Lucee and having a problem with comments. I had the following in my cfm file::

<!--<cfquery name="qry" datasource="dpi">
	select CustomerName from tblcustomers
</cfquery>-->

and a table which referred to it:

<cfoutput query="qry">

When I run it though my browser ( tried both FireFox and Chrome), I don’t get an error and the page executes as though the comments weren’t there. Have I missed something?


#2

Please repost with your code :slight_smile:


#3

Just use a HTML comment two -'s instead of three, cfml comments are filtered out automatically?


#5

You need three dashes.
So…

<!---<cfquery name="qry" datasource="dpi">
	select CustomerName from tblcustomers
</cfquery>--->

Two dashes is for HTML (which is processed by browser client side) and three dashes for CFML (which is processed by Lucee server side before it is sent out to the client).

If you look at the page source code via the browser, I bet you won’t see the tag or tag since they have already been processed by Lucee and turned into the relevant HTML.


#6

Excellent, that did the job! Many thanks for your assistance.


#7

First of all,when you are getting an error,dump any variable before that line where the actual error occurred.