What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » im having troble with my script

im having troble with my script
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: im having troble with my script
quote:
Originally posted by Volv
matty, unless I'm mistaken, that doesn't allow you to get the element's index in the array and hence you can't get the corresponding response =/
No, that's why the variable i is there! Actually, it doesn't matter what method you choose, it'll always give you a loop through the array. However, if you're trying this on an object, you have to use Matty's method because an object doesn't have numeral indexes. Instead, the i variable contains the key name of the object value. For example:
code:
var FruitColors = function() {
   this.Banana = "yellow"; //"Banana" is not numeral and therefore you can't use a number to iterate through this object
   this.Apple = "red";
   this.Pear = "green";
}
var MyObject = new FruitColors();
for(var i in MyObject) {
   Debug.Trace("The color of "+i+"s is "+FruitColors[i]); //Output: "The color of Bananas is yellow" etc.
}

Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-08-2007 03:19 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
im having troble with my script - by killa on 08-06-2007 at 05:23 PM
RE: im having troble with my script - by pollolibredegrasa on 08-06-2007 at 05:53 PM
RE: im having troble with my script - by killa on 08-07-2007 at 01:40 PM
RE: im having troble with my script - by Volv on 08-07-2007 at 01:55 PM
RE: im having troble with my script - by killa on 08-08-2007 at 10:00 AM
RE: im having troble with my script - by Volv on 08-08-2007 at 10:40 AM
RE: im having troble with my script - by LifelesS on 08-08-2007 at 10:51 AM
RE: im having troble with my script - by matty on 08-08-2007 at 12:47 PM
RE: im having troble with my script - by Volv on 08-08-2007 at 01:01 PM
RE: im having troble with my script - by Matti on 08-08-2007 at 03:19 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