What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Replace Colour Codes

Replace Colour Codes
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. Replace Colour Codes
I'm trying to convert a string containing BBcode colours into the old 3.xx style. It seems to work partially (It converts the first few, but not others). This is the code I'm using at the moment:

code:
    for(var a=0;a<=54;a++){
    var before = "[c="+a+"]";
    var after = "·$"+a+" ";
    strMyNewPSM = strMyNewPSM.replace(before,after);
    }
    Debug.Trace(strMyNewPSM);   
    strMyNewPSM = strMyNewPSM.replace('[/c]','·$1');
    Messenger.MyPersonalMessage = strMyNewPSM;


Any ideas why its not working properly?

Also, I need to remove leading spaces... I know how to check for them, but not how to remove them.
<Eljay> "Problems encountered: shit blew up" :zippy:
09-07-2006 08:20 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Replace Colour Codes - by Spunky on 09-07-2006 at 08:20 PM
RE: Replace Colour Codes - by alexp2_ad on 09-07-2006 at 08:31 PM
RE: Replace Colour Codes - by Spunky on 09-07-2006 at 08:32 PM
RE: Replace Colour Codes - by KnRd_WC on 09-07-2006 at 09:15 PM
RE: Replace Colour Codes - by deAd on 09-07-2006 at 09:17 PM
RE: Replace Colour Codes - by Spunky on 09-07-2006 at 09:18 PM
RE: Replace Colour Codes - by Shondoit on 09-08-2006 at 03:42 PM
RE: Replace Colour Codes - by Matti on 09-08-2006 at 04:17 PM
RE: Replace Colour Codes - by Shondoit on 09-08-2006 at 04:21 PM
RE: Replace Colour Codes - by CookieRevised on 09-08-2006 at 04:35 PM
RE: Replace Colour Codes - by Shondoit on 09-08-2006 at 04:45 PM
RE: RE: Replace Colour Codes - by CookieRevised on 09-08-2006 at 04:51 PM
RE: Replace Colour Codes - by Shondoit on 09-08-2006 at 04:57 PM
RE: Replace Colour Codes - by CookieRevised on 09-08-2006 at 05:07 PM
RE: Replace Colour Codes - by Spunky on 09-08-2006 at 05:15 PM
RE: Replace Colour Codes - by Eljay on 09-08-2006 at 05:20 PM
RE: Replace Colour Codes - by Spunky on 09-08-2006 at 05:23 PM
RE: Replace Colour Codes - by CookieRevised on 09-08-2006 at 05:24 PM
RE: Replace Colour Codes - by Spunky on 09-08-2006 at 05:28 PM
RE: Replace Colour Codes - by Shondoit on 09-08-2006 at 10:40 PM
RE: Replace Colour Codes - by Spunky on 09-08-2006 at 10:43 PM
RE: Replace Colour Codes - by Shondoit on 09-08-2006 at 10:49 PM
RE: Replace Colour Codes - by Spunky on 09-08-2006 at 10:51 PM
RE: Replace Colour Codes - by Shondoit on 09-08-2006 at 10:53 PM
RE: RE: Replace Colour Codes - by CookieRevised on 09-09-2006 at 02:08 AM


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