Thanks for the reply, I am trying to avoid writing the following over
and over
when the only thing that is going to change is the grap.getCol==1 and
the 1 in the name of the int g1m0

I am looping through a list of graphics that are coming from multiple
graphic arrays(7 total each representing its column) so they have
different columns  and rows.
If it finds a match I want to add 1 to the corresponding in for
example: if the array contains a graphic at grap.getCol()==6 &&
grap.getRow()==3 I want to add 1 to the int g6m3(note this pre defined
int corresponds with the dol and row # respectivly)


for (Graphic grap : _toCompare) {
                        if(grap.getCol()==1 && grap.getRow()==1){
                                g1m0+=1;
                        }else if(grap.getCol()==1 && grap.getRow()==2){
                                g1m0+=1;
                                g1m1+=1;
                        }else if(grap.getCol()==1 && grap.getRow()==3){
                                g1m0+=1;
                                g1m1+=1;
                                g1m2+=1;
                        }else if(grap.getCol()==1 && grap.getRow()==4){
                                g1m0+=1;
                                g1m1+=1;
                                g1m2+=1;
                                g1m3+=1;
                        }else if(grap.getCol()==1 && grap.getRow()==5){
                                g1m0+=1;
                                g1m1+=1;
                                g1m2+=1;
                                g1m3+=1;
                                g1m4+=1;
                        }else if(grap.getCol()==1 && grap.getRow()==6){
                                g1m0+=1;
                                g1m1+=1;
                                g1m2+=1;
                                g1m3+=1;
                                g1m4+=1;
                                g1m5+=1;
                          }
for (Graphic grap : _toCompare) {
                        if(grap.getCol()==2 && grap.getRow()==1){
                                g2m0+=1;
                        }else if(grap.getCol()==2 && grap.getRow()==2){
                                g2m0+=1;
                                g2m1+=1;
                        }else if(grap.getCol()==2 && grap.getRow()==3){
                                g2m0+=1;
                                g2m1+=1;
                                g2m2+=1;
                        }else if(grap.getCol()==2 && grap.getRow()==4){
                                g2m0+=1;
                                g2m1+=1;
                                g2m2+=1;
                                g2m3+=1;
                        }else if(grap.getCol()==2 && grap.getRow()==5){
                                g2m0+=1;
                                g2m1+=1;....



On Oct 29, 12:12 pm, TreKing <treking...@gmail.com> wrote:
> On Fri, Oct 29, 2010 at 10:55 AM, acr <acr...@gmail.com> wrote:
> > so through each iteration g1m0 would become g2mo
>
> You can't do that.
>
> What are you trying to do?
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to