One loop for two arrays

2003-07-22 Thread Vincent Peytavin
Hello,

I have 2 arrays, where elements correspond, that's to say list1[i] go with
list2[i].
For example, imagine list1 stands for "names" and "list2" for "surnames".
names[0]=Peytavin surnames[0]=Vincent
names[1]=Jackson  surnames[1]=Michael
...

The difficulty is to set in a variable 'surname' (?) the element
value with index i (i being defined in the loop which handles "surnames"
list), in order to be able to manipulate 'surname' with the same possibility
as 'name'.
(I hope I'm clear!)


   // Something which puts in 'surname' the value of 'list2[i]'



Thanks for your help!

--
Vincent



Re: One loop for two arrays

2003-07-22 Thread Michael Duffy
Sounds like a Map might be more applicable - names as
keys, surnames as values.

--- Vincent Peytavin <[EMAIL PROTECTED]>
wrote:
> Hello,
> 
> I have 2 arrays, where elements correspond, that's
> to say list1[i] go with
> list2[i].
> For example, imagine list1 stands for "names" and
> "list2" for "surnames".
> names[0]=Peytavin surnames[0]=Vincent
> names[1]=Jackson  surnames[1]=Michael
> ...
> 
> The difficulty is to set in a variable 'surname'
> (?) the element
> value with index i (i being defined in the loop
> which handles "surnames"
> list), in order to be able to manipulate 'surname'
> with the same possibility
> as 'name'.
> (I hope I'm clear!)
> 
>  varStatus="i">
>// Something which puts in 'surname' the value of
> 'list2[i]'
> 
> 
> 
> Thanks for your help!
> 
> --
> Vincent
> 
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: One loop for two arrays

2003-07-22 Thread Vincent Peytavin
> Sounds like a Map might be more applicable - names as
> keys, surnames as values.

Please, don't focus on the name/surname : this is not the problem.
I have several arrays, and i need to go through them in the same time (based
on the same index).

How can i do that?

--
Vincent


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: One loop for two arrays

2003-07-22 Thread Chen, Gin
You were on the right track.
Use the varStatus with a c:set.
I'm not sure what the problem is.
-Tim

-Original Message-
From: Vincent Peytavin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 22, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: One loop for two arrays


> Sounds like a Map might be more applicable - names as
> keys, surnames as values.

Please, don't focus on the name/surname : this is not the problem.
I have several arrays, and i need to go through them in the same time (based
on the same index).

How can i do that?

--
Vincent


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: One loop for two arrays

2003-07-22 Thread Felipe Leme
On Tuesday 22 July 2003 12:44 pm, Vincent Peytavin wrote: 

> 
>// Something which puts in 'surname' the value of 'list2[i]'
>
> 


I think the "something" could be something like::



Is that what you want?

Felipe


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: One loop for two arrays

2003-07-22 Thread Kris Schneider
The type of the "varStatus" attribute is
javax.servlet.jsp.jstl.core.LoopTagStatus. This interface exports a number of
properties, including "index" and "count". I think you need:



Quoting Felipe Leme <[EMAIL PROTECTED]>:

> On Tuesday 22 July 2003 12:44 pm, Vincent Peytavin wrote: 
> 
> > 
> >// Something which puts in 'surname' the value of 'list2[i]'
> >
> > 
> 
> 
> I think the "something" could be something like::
> 
> 
> 
> Is that what you want?
> 
> Felipe


-- 
Kris Schneider 
D.O.Tech   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: One loop for two arrays

2003-07-22 Thread Felipe Leme
On Tuesday 22 July 2003 01:50 pm, Kris Schneider kris-at-dotech.com |jakarta| 
wrote:
> The type of the "varStatus" attribute is
> javax.servlet.jsp.jstl.core.LoopTagStatus. This interface exports a number

Yes, I know :(

> of properties, including "index" and "count". I think you need:
> 

I took the list2[i] approach from a scratch page I had used for tests. I guess 
the getIndex() method is returned by default (or maybe my example was wrong 
:-). 

Anyway, you're right, the index property is the right way to do it...

Felipe

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: One loop for two arrays

2003-07-23 Thread Vincent Peytavin
On Tuesday 22 July 2003 01:50 pm, Kris Schneider kris-at-dotech.com
|jakarta|
wrote:
>
>> of properties, including "index" and "count". I think you need:
>> 
>
>I took the list2[i] approach from a scratch page I had used for tests. I
guess
>the getIndex() method is returned by default (or maybe my example was wrong
>:-).


Thanks for your help and your explications.
:-)

--
Vincent


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]