Jo
Posts: 3
Nickname: jodedor
Registered: Feb, 2003
|
|
Re: need help with a loop
|
Posted: Feb 3, 2003 12:00 PM
|
|
> Hello again > The code below prints out this > [7,4,2,1,0] > addr1, id, phone, lastname, firstname > [9,8,6,5,3] > town, addr2, postcode, county, country > > > for (int ii2=0;ii2 < results2.size(); ii2++) { > vv2 = (Vector)results2.elementAt(ii2); > ste2 = vv2.toString(); > stb2 = new StringBuffer(ste2); > stb12 = new StringBuffer(); > int is = stb2.length(); > int is2 = is-2; > int is3 = is-1; > stb2.replace(0,1,""); > stb2.replace(is2,is3,""); > for(int i222 = 0; i222 < vv2.size(); i222++){ > stb12.append(","); > stb12.append("?"); > } > stb12.replace(0,1,""); > System.out.println(stb2); > vv = (Vector)results.get(ii2); > System.out.println(vv); > } > >
> my problem now is that i want to put another loop inside > of it so that my code will print this > ben > [7,4,2,1,0] > addr1, id, phone, lastname, firstname > alex > [9,8,6,5,3] > town, addr2, postcode, county, country > this is my loop. > > //names holds ben, alex. > for (i = 0; i < names.size(); i++){ > String name = (String)results1.get(i); > System.out.println(name); > } >
> thanks > ben
Not sure what you want to do but you dont need another loop inside, it appears that the logic to call the name should go on the outside. That is identify the user, then find the data. Perhaps you should post some pseudocode that illustrates what it is that you are trying to acomplish.
|
|