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

Replace Problem
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. Replace Problem
I'm having trouble with the following code:

js code:
// x[0] is a string
// y is an array (that in these circumstances does NOT contain x[0]
if(strip(x[0]) in y){ //strip just removes non-alphanumeric characters
    var foo = bar.replace(x[0], y[x[0]]);
    Debug.Trace(x[0] + " - " + y[x[0]]);
}

If x[0] is set to "push", "join", "reverse", "pop" or any other array method then I get "Object Expected" error and it traces:

quote:
pop -
function pop() {
    [native code]
}



Any ideas why? Everything should just be treated as a string :s I'm probably being stupid

This post was edited on 08-02-2011 at 08:23 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
08-02-2011 08:21 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Replace Problem - by Spunky on 08-02-2011 at 08:21 PM
RE: Replace Problem - by matty on 08-02-2011 at 08:33 PM
RE: Replace Problem - by Spunky on 08-02-2011 at 08:36 PM
RE: Replace Problem - by Eljay on 08-02-2011 at 08:48 PM
RE: Replace Problem - by whiz on 08-02-2011 at 08:48 PM
RE: Replace Problem - by Spunky on 08-02-2011 at 08:52 PM
RE: Replace Problem - by Eljay on 08-02-2011 at 09:00 PM
RE: Replace Problem - by Spunky on 08-02-2011 at 09:02 PM
RE: Replace Problem - by Matti on 08-03-2011 at 08:50 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