Forum Topic: Arrays Question

(247 views • 6 replies)

This topic is 1 page long.

<< < > >>
None

Mr-Money

Reply To Post Reply & Quote

Posted at: 7/13/06 09:30 AM

Mr-Money NEUTRAL LEVEL 15

Sign-Up: 11/05/05

Posts: 2,272

OK, so I know how to make and read arrays and everything, but I have another question.

Let's say I type 0,1 into an input text box and I want the 0 and 1 to be read as separate parts of an array, ie 0 is [0] and 1 is [1], how would I do this??

I can only get the whole thing (0,1) to be read as part [0]


None

Snubby

Reply To Post Reply & Quote

Posted at: 7/13/06 09:32 AM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,145

I could help if you made the question clearer. Sorry, I just don't understand.


None

Snubby

Reply To Post Reply & Quote

Posted at: 7/13/06 09:35 AM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,145

At 7/13/06 09:32 AM, Snubby wrote: I could help if you made the question clearer. Sorry, I just don't understand.

Woops sorry I was just being an idiot, I understand now.
- - - - - - - - - -
What you are trying to do is really really hard. You should find an alternative, like having 2 different text boxes or changing the aspect. If it was dynamic you could...

var arrayName = new Array("first", "second");
inputText.text = arrayName[0] + ", " + arrayName[1];

But it's really really hard to disect an already written text.


None

Mr-Money

Reply To Post Reply & Quote

Posted at: 7/13/06 09:37 AM

Mr-Money NEUTRAL LEVEL 15

Sign-Up: 11/05/05

Posts: 2,272

Hmmm... well, do you have any idea of how it's done? Using more than one text box would be annoying to the user. They did it with punk-o-matic, so I'm sure it can be done. I'm willing to learn!


None

DJStatika

Reply To Post Reply & Quote

Posted at: 7/13/06 10:55 AM

DJStatika NEUTRAL LEVEL 04

Sign-Up: 04/19/05

Posts: 43

myarray = mytextfieldvariable.split(",")


None

Mr-Money

Reply To Post Reply & Quote

Posted at: 7/13/06 11:00 AM

Mr-Money NEUTRAL LEVEL 15

Sign-Up: 11/05/05

Posts: 2,272

At 7/13/06 10:55 AM, DJStatika wrote: myarray = mytextfieldvariable.split(",")

I really do like you, a lot.


All times are Eastern Standard Time (GMT -5) | Current Time: 08:31 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!