944,030 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 11421
  • ColdFusion RSS
Jul 31st, 2005
0

hash symbol in a tag

Expand Post »
im not quite sure what this means, ive got this sample code that im trying to figure out:
<FORM ACTION ="QUIZ_RESULTS.CFM" METHOD="POST">
<P><HR><B> QUESTION ###CURRENTROW# IS:</B>
<BR><I> #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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nitinmenon is offline Offline
3 posts
since Jul 2005
Aug 1st, 2005
0

Re: hash symbol in a tag

Quote originally posted by nitinmenon ...
im not quite sure what this means, ive got this sample code that im trying to figure out:
<FORM ACTION ="QUIZ_RESULTS.CFM" METHOD="POST">
<P><HR><B> QUESTION ###CURRENTROW# IS:</B>
<BR><I> #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.
Reputation Points: 53
Solved Threads: 1
Posting Whiz
red_evolve is offline Offline
313 posts
since Jun 2003
Aug 4th, 2005
0

Re: hash symbol in a tag

Quote originally posted by nitinmenon ...
im not quite sure what this means, ive got this sample code that im trying to figure out:
<FORM ACTION ="QUIZ_RESULTS.CFM" METHOD="POST">
<P><HR><B> QUESTION ###CURRENTROW# IS:</B>
<BR><I> #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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ProFreelance is offline Offline
17 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: new project
Next Thread in ColdFusion Forum Timeline: ColdFusion and Windows xp 64 bit





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC