RE: Outputting a hash character in an IIF() function.

2008-01-09 Thread Bobby Hartsfield
if (foo) {bar='a';} else {bar='b';} Now it's one line... who didn't see that coming? :-P ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic

Re: Outputting a hash character in an IIF() function.

2008-01-09 Thread Ian Skinner
Tom Chiverton wrote: > if (foo){ > bar=a > }else{ > bar=b > } > b > > seems clearer to me than nested iif and de. This is completely personal preference and a very very small matter. But I generally find less to be clearer then more. -- if (foo) { bar='a'; } else { bar

Re: Outputting a hash character in an IIF() function.

2008-01-09 Thread Ian Skinner
Brad Wood wrote: > The hash simply needs to be escaped as > #iif(bgFlag,DE(' style="background-color: DDFFDD"'),DE(''))# > > The hash needs to be escaped twice since you are delaying evaluation. > > The text: > style="background-color: DDFFDD" > > Is passed out of the de function as (in

RE: Outputting a hash character in an IIF() function.

2008-01-09 Thread Brad Wood
Actually, if I am going to use braces, I like them to align vertically for better readability: if (foo) { bar = a; } else { bar = b; } But enough of this. He didn't ask for our opinions in code readability, he asked how to escape a

RE: Outputting a hash character in an IIF() function.

2008-01-09 Thread Brad Wood
ction as (including the quotes): " style=""background-color: ##DDFFDD""" That text is then evaluated by the iif to: style="background-color: #DDFFDD" ~Brad -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January

Re: Outputting a hash character in an IIF() function.

2008-01-09 Thread Tom Chiverton
On Wednesday 09 Jan 2008, Ian Skinner wrote: > Generally because I prefer to KNOW why I have to replace one clear line > of code with 5 lines of slightly less clear code that requires the using > a few bits more memory to store a variable I will not use any place else. if (foo){ bar=a }els

Re: Outputting a hash character in an IIF() function.

2008-01-09 Thread Ian Skinner
Dave wrote: > Have you tried assigning it to a variable in a cfset and then displaying the > variable. Alternately, convert to RGB: style="background-color:rgb(221 255 > 221)"' Yes I can set and use a variable, but I was curious why I would have to do this. Why do I need to create five lines to

Re: Outputting a hash character in an IIF() function.

2008-01-09 Thread Ian Skinner
Tom Chiverton wrote: > On Wednesday 09 Jan 2008, Ian Skinner wrote: > >> I'm having trouble with this and the usual tricks don't seem to be working. >> #iif(bgFlag,DE(' style="background-color: #DDFFDD"'),DE(''))# >> > Why not just rewrite it so as not to use iif or de ? Generally because I

RE: Outputting a hash character in an IIF() function.

2008-01-09 Thread Dave
08 9:34 AM > To: CF-Talk > Subject: Outputting a hash character in an IIF() function. > > I'm having trouble with this and the usual tricks don't seem > to be working. > > #iif(bgFlag,DE(' style="background-color: #DDFFDD"'),DE(''))# >

Re: Outputting a hash character in an IIF() function.

2008-01-09 Thread Tom Chiverton
On Wednesday 09 Jan 2008, Ian Skinner wrote: > I'm having trouble with this and the usual tricks don't seem to be working. > #iif(bgFlag,DE(' style="background-color: #DDFFDD"'),DE(''))# Why not just rewrite it so as not to use iif or de ? -- Tom Chiverton Helping to administratively architect s

Outputting a hash character in an IIF() function.

2008-01-09 Thread Ian Skinner
I'm having trouble with this and the usual tricks don't seem to be working. #iif(bgFlag,DE(' style="background-color: #DDFFDD"'),DE(''))# This fails. I have tried escaping the internal hash character by doubling. I have tried to concatenate chr(35). Everything I do throws exceptions involving