Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

chaining arrays

Recommended Posts

[b]SOLVED-Problem completely solved thanks for all the help.[/b]I am building a small database with javascript, for recalling information in a mini-program, what I am trying to do, well I don't want to go into all that, What I want to ask is there a way, because I have to put in all the information, is there a way for me to paste information into a document, then with javascript someone automatically turn all the bits of information into an array.
because I am creating about 7 arrays, and wanting them all the be associative arrays pointing to the same keys, for instance
Key 1-has 10 different arrays hooked to it and if I call that 1 then all the information comes for instance
Array 1
[1] baboon
[2]cat
array 2
[1] hairy
[2] 4 legs
array 3
[1]stupid
[2]2 legs
It's not what an array looks like but you get the point, if that 1 is called then it pulls hte information saying baboon, hairy, and stupid.
If I was to use the variable baboon instead of the key selector it still calls all the information, I am wanting to be able to change a lot of information into an array without having to type it all out, then I can just pretty it up, and put in the information and create another array, because javascript automatically indexes them at 0 and above, I will already have the key indexes set, and the arrays will still be callable by those keys.
Any advice would be appreciated thanks.

Share this post


Link to post
Share on other sites
why don't you just use a multi-dimensional array

array[0][0]='babbon';
array[0][1]='hairy';
array[0][2]='stupid';

Share this post


Link to post
Share on other sites
Because I can't type out a thousand lines of code to do it, that is what made me not do it in the first place.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.