954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

hash symbol in a tag

im not quite sure what this means, ive got this sample code that im trying to figure out:


QUESTION ###CURRENTROW# IS:

#QUESTION#>

the second line is really what i dont understand. I understand that it is the value of the variable between the hash symbols that is really the o/p, but whats with the three hash symbols.
thanks

nitinmenon
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

im not quite sure what this means, ive got this sample code that im trying to figure out:

QUESTION ###CURRENTROW# IS:
#QUESTION#>

the second line is really what i dont understand. I understand that it is the value of the variable between the hash symbols that is really the o/p, but whats with the three hash symbols. thanks

Ok, when you try to load the cfm file, you'll see:-
Question #1 is: bla bla bla
If it's in a loop, you might see:-
Question #1 is: abc
Question #2 is: def
Question #3 is: ghi
and so on...

There are 3 hash signs because firstly, you'd want to display a hash sign on your webpage, but because CF uses hash sign to distinguish its variables, you have to escape it. You can tell coldfusion not to evaluate the hash sign by escaping it with a hash sign. So ## actually means display a # on my webpage. The 3rd # continued with currentrow# is telling CF to return the variable currentrow.

Hth.

red_evolve
Posting Whiz
313 posts since Jun 2003
Reputation Points: 53
Solved Threads: 1
 

im not quite sure what this means, ive got this sample code that im trying to figure out:

QUESTION ###CURRENTROW# IS:
#QUESTION#>

the second line is really what i dont understand. I understand that it is the value of the variable between the hash symbols that is really the o/p, but whats with the three hash symbols. thanks

It makes a little more sense if you look at it like this:

<P><HR><B> QUESTION ###CURRENTROW# IS:</B>


The##, is a # that has been escaped with another #, and eventually outputs simply one #.

The #CURRENTROW# is a variable that is encapsulated in #s to denote that it is a variable.

ProFreelance
Newbie Poster
17 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You