Re: Issue with array length in for loop
Steven Kennedy wrote:
//Populate the race array
Vector<Race> raceVect = new =
Vector<Race>();
for (int i=1;i<=raceCount;i++=
) {
jockVect = new Vector<Jockey>();
= "0" + Integer.toString(i);
h()==3){
mpRace = tmpRace.substring(1);
http://www.tab.com.au/Racing/Betting/StandardBets/"
+
... ...
Jockey[] jArray =
= new Jockey[jockVect.size()];
ew
Race(Integer.parseInt(tmpRace),jockVect.toArray(jArray)));
}
Notice that 'tmpRace' is a 'String' built from an 'int' whose sole
purpose is to turn back into the exact same 'int' from which it came,
after some string manipulations that have no net effect, so that a
'Vector' (!) can be built in order to turn into an array.
You could just pass the original 'int' ('i' in this case) directly to
the 'Race' constructor.
--
Lew
Ceci n'est pas une pipe.