What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [split] multi-dimensional arrays

[split] multi-dimensional arrays
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Question] Timer usage
quote:
Originally posted by Mattike
quote:
Originally posted by L. Coyote
I once needed this type of array and had to do this:
code:
var arr = new Array();
arr[0] = new Array();
arr[0][0] = "blah";

That's also the way I do it. I have no idea how JScript would react if you try to add an array element to an array element which is undefined at that moment... Maybe I should try it. :P

Another way you could do it, would be:
code:
var arr = new Array(new Array("thing", "stuff"), new Array("crap", "blah"));

Both ways are exactly the same

quote:
Originally posted by tryxter
Multidimensional arrays aren't well explained on MS documentation.
Because they don't exist in JScript.

JScript does not support multidimensional arrays (which is well explained in the help page on the Array object).

To simulate multidimensional arrays you need to define a new array as part of another array element.

Hence, arr[0][0] isn't a multidemensional array (which would be only one object), it is an array which consists of other arrays (which are 1 + number of elements objects), which is quite different.

This post was edited on 01-11-2007 at 06:22 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-10-2007 07:38 AM
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