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

Increment letter? 1

Status
Not open for further replies.

shmmeee

Programmer
Apr 17, 2001
104
GB
Hi,
I need to increment a character in my javascript. I can't find anywhere how to do it, I've tried charVar++; but that gives NaN, I was wandering if there is maybe an ascii-to-integer/integer-to-ascii function or if someone knows some other way of doing this. Any help would be much appreciated.

TIA,
Iain
 
hie shmmeee, there is smth like what u're after:
String.fromCharCode(nASCII)
or may be escape() or unescape() regards, vic
 
Hi Vic,
thanks for your quick response (shouldn't have expected anything less from you :)). From what I can see
Code:
String.fromCharCode(nASCII)
only works in IE and unfortunatly I need it working in both IE and NS4.75 :-( I looked at escape and unescape and I think (correct me if I'm wrong) that they only escape non alphanumeric characters (like: !,%,$,£ etc.).
I hope this isn't another problem I can't solve, this project has thrown enough of them up already! Anyway thanks for the help, but if you think of anything else don't hesitate to tell me :)

TIA,
Iain X-)
 
sorry u're totally right, escape & unescape r for those symbols, i should tell u about that.. :-(
what about see String.fromCharCode(nASCII) , i dont kno, didnt used it m
well, i am useless & gone away, may be someone else?? regards, vic
 
Vic,
my bad, I didn't look in the right places, where ever told me that fromCharCode() only works in IE was wrong by the looks of it. It works perfectly, thanks for your help. (you are far from useless :)).

Iain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top