Skip to main content
Known Participant
October 24, 2007
Question

What to use for comment

  • October 24, 2007
  • 4 replies
  • 491 views
In my .cfm file I have a few CFFUNCTION
Within my CFFUNCTION I have a big chunk of <cfscript></cfscript>
Within <cfscript >I have codes written in block of if else if statements this way:

<CFFUNCTION name="Bla">

<cfscript>
....
....
if (listFind("3,5,6",getFormsForPlan.FormID) AND len(trim(A_New[53])))
{
.....
.....
.....
structFormText[numKey][1]["formText"] = " <b>CHOOSE THE PERCENTAGE OF.....</b>";
structFormText[numKey][1]["XPosition"] = "73";
structFormText[numKey][2]["XPosition"] = "73";
.....
.....
.....
}

other similar block of codes from here down

</cfscript>

<CFFUNCTION>

If I want to comment out ONE whole block of code, Starting from if.... { and end in } what should I use?
// on every line OR /* */ ?

Since I'm commenting out a block of code I would assume using /* */ is better and more logical than putting // on each line but when I use /* */, a few lines did not turn grey especially the text: <b>CHOOSE THE PERCENTAGE OF.....</b>"; but others turn grey
Please help!

This topic has been closed for replies.

4 replies

Inspiring
October 25, 2007
nanuji wrote:
> use this <!--- put commented block of code here --->

That style commenting is illeagle inside a <cfscript>...</cfscript>
block. Inside a script block you use the following comment markup.

// comments a single like until the end of the character.

/* */ multiple line comment characters.

October 25, 2007
use this <!--- put commented block of code here --->
Inspiring
October 24, 2007
> did not turn grey especially the text: CHOOSE THE PERCENTAGE OF.....";
> but others turn grey

Syntax highlighting has nothing to do with the code, it's just your text
editor trying to be helpful by making things colourful. And sometimes the
text editor will cock it up (CFEclipse is especially good at this, I find).

If you *run your code* does it work as expected?

--
Adam
aleckenAuthor
Known Participant
October 25, 2007
yes, you right! I'm using Eclipse and I tried it yesterday the /* */ worked even my eclipse editor did not turn some text to grey
Thank you for confirming that.
Inspiring
October 24, 2007
Nested comments don't work.