What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » a problem scripting :/ [NOW SOLVED THANKS]

a problem scripting :/ [NOW SOLVED THANKS]
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: a problem scripting :/
This is because you will just be doing one replace after the other on the one string. For example if you had the string "ABC" and replaced "A" with "B" and then "B" with "C" you will just end up with "CCC" rather than the "BCC" you were after.

To overcome this you will have to put the changes into a new variable.  This code should help with what you need (using what you have written).

code:
var alpha = "abcdefghijklmnopqrstuvwxyz";
var code = "ypltavkrezgmshubxncdijfqow";
var Split = Message.split("");
var eSplit = new Array();
for(i=0;i<Split.length;i++){
    for(j=0;j<alpha.length;j++){
        if(Split[i] == alpha.charAt(j)){
            eSplit[i] = code.charAt(j);
            break;
        }
if(j == alpha.length){
eSplit[i] = Split[i];
}
    }
}
var eMessage = eSplit.join("");
Debug.Trace(eMessage);

I hope this extract helps you.

EDIT: Forgot to pass other characters, all fixed now though.

This post was edited on 02-14-2007 at 11:07 PM by markee.
[Image: markee.png]
02-13-2007 10:39 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
a problem scripting :/ [NOW SOLVED THANKS] - by Red King on 02-13-2007 at 10:14 PM
RE: a problem scripting :/ - by pollolibredegrasa on 02-13-2007 at 10:23 PM
RE: a problem scripting :/ - by Eljay on 02-13-2007 at 10:24 PM
RE: a problem scripting :/ - by Red King on 02-13-2007 at 10:25 PM
RE: a problem scripting :/ - by markee on 02-13-2007 at 10:39 PM
RE: RE: a problem scripting :/ - by Red King on 02-13-2007 at 10:48 PM
RE: a problem scripting :/ - by Matti on 02-14-2007 at 02:18 PM
RE: RE: a problem scripting :/ - by Red King on 02-14-2007 at 08:47 PM
RE: a problem scripting :/ [NOW SOLVED THANKS] - by markee on 02-14-2007 at 11:04 PM
RE: a problem scripting :/ [NOW SOLVED THANKS] - by Red King on 02-14-2007 at 11:09 PM


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