Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<CFSET newVariable = #oldVariable# & "text"> not working. 3

Status
Not open for further replies.

KevinFSI

Programmer
Nov 17, 2000
582
US
I shouldn't say it's not working. It's syntactically correct in that it doesn't generate an error, but I need an extra white space in there and don't know how to do it.

Here's what I have:
Code:
<CFSET comp_hours = #SumOfHours# & &quot;hrs.&quot;>

That gives me this:
16hrs.

What I want is this:
16 hrs.

I tried &nbsp; in the CFSET but it didn't work. I also tried writing it like &quot; hrs.&quot; but that didn't work either.

Does anyone know how to get a space between the 16 and hrs.? Kevin
slanek@ssd.fsi.com
 
I think this is what you want:

<CFSET comp_hours = &quot;#SumOfHours# hrs.&quot;>

You can embed CF functions and variables within double quote strings.
 
Man, I tell ya. I swear that was the VERY first thing I tried and it didn't work, but I must be full of it. I just tried it a few minutes ago and it worked. Thanks a million because I doubt I would've ever tried it again (since I thought I already did.) What a dunce.

Thanks again. Kevin
slanek@ssd.fsi.com
 
If <CFSET comp_hours = #SumOfHours# &amp; &quot;hrs.&quot;> gave you &quot;16hrs.&quot;
<CFSET comp_hours = #SumOfHours# &amp; &quot; hrs.&quot;> would have given you &quot;16 hrs.&quot;

Simon
 
yes, and if the &quot; &quot; was not recognasized, you could still use the chr(??) (?? is because i don't know the exact value !!)
but gunjack's idea is fine anyway :]
 
No, <CFSET comp_hours = #SumOfHours# &amp; &quot; hrs.&quot;> did not work. I tried it again just to verify. I also tried <CFSET comp_hours = #SumOfHours# &amp; &quot; &quot; &amp; &quot;hrs.&quot;> for S &amp; G's but it didn't cut it either.

As far as I'm concerned, GunJack was right on the money. Anything else is extra code. Kevin
slanek@ssd.fsi.com
 
<CFSET comp_hours = #SumOfHours# &amp; chr(??) &amp; &quot;hrs.&quot;> should work (if you replace the ?? with the actual code for &quot;space&quot;)
but as you said gunjack's right, his solution is smart, so we don't really need any other. This was just to be complete and precise.
 
You're absolutely right! Hey, I may end up using your suggestion in some manner also, iza. I thank all of you for the input.
Also, if anyone is interested, the code for a space is
Code:
&amp;#32;

Thanks again. Kevin
slanek@ssd.fsi.com
 
*i* was interested ;]
where do you find the reference for those codes ? is there an url you can give me ? thanx :)))
 
iza,
You could also find these in the VB / Visual Studio / MSDN if you search for ASCII.

Simon
 
thanx :)
is that because it's christmas time or it's tek-tips, everyone is sooooooooooo nice ?!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top