hmm,
I've been trying to get the charCodeAt function working. However it just dosn't want to.
I copied out of the example, but it gives me the same result everytime I choose a letter (upper or lowercase makes no difference) or anything else other than numbers. I also tried adding other signs to the string, str, (lowercase alphabet, numbers). But that only increases the size of the number it returns.
the number I get with the code copied out of the example is 65. if the char I send is a number it returns '65 + n'.
heres the code I have,
code:
function charCodeAtTest( n ){
var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //Initialize variable.
return str.charCodeAt(n - 1); //Return Unicode value of the character.
}
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
return '' + charCodeAtTest(Message.charAt(0));
}
Anyone know what I'm doing wrong?