What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [split] What scripts can't do.

[split] What scripts can't do.
Author: Message:
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: [split] What scripts can't do.
quote:
Originally posted by waterbottle
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? :)
In that code you are passing a char (or a 1 byte string) to the function, you are then treating it as an integer when you subtract one. And if im not mistaken the n - 1 part would equate to NaN (not a number) because you are subtracting one from a string. I don't really understand what you are trying todo so i can't really give you any tips :P
12-15-2006 11:06 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On