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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Character Escaping

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
CA
Simple question:

I want to put a degree sign in a variable that will be assigned to a variable text field. I know the ascii escape code (Not in front of me now, let's say it's (escape sequence here - Tek-Tips keeps processing it for me)).

I set the variable like as an array in the beginning:

Code:
quiz[x][3] = "Must use 150 (escape sequence) F water"

Then later I set the variable that is the variable text field equal to that array element:

Code:
varfortext = quiz[x][3]

I've tried all variations of unescape and everything, but I can't get it to display anything but the actual escape sequence (ampersand-numbersign-whatever-the-code-is-plus-a-semi-colon)...

Any suggestions?

Ben
 
ok, maybe i get it wrong but i tried it like this :
Code:
vartxt="£=(alt+157)  =(alt+155)";
_root.txttxt=vartxt;
and it works. (by the way,
Code:
txttxt
is the name of the variable in the text field, not the name of the textfield) Diana.
 
Hi Diana

Good point about the variable in the text field as opposed to the name of the textfield. I think I'm missing somehting obvious, but I'm not sure what your script shows me...has tek-tips processed some of your character codes? What are you putting in vartxt? Is it (imagine the concatenated string here... &+#+157; or are you actually putting alt+157?

Sorry for missing the obvious here...

Ben
 
Got it...

Code:
quiz[x][1] = "You must wash your hands at 150" + unescape("\u00b0") + " F."

I was trying to use ASCII escape codes, not Unicode.

B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top