On Jan 6, 2009, at 3:17 PM, chen li wrote: > One more question: I want to iterate a slice(here is 5) from an > array. Here is my code. Is it the best way to iterate a slice? I think you probably want to make the index counters (index1, index2, ...) instance variables instead of local variables. But I guess it's OK otherwise.