Why do I get "Cannot be Resolved" errors in this code?
<p>I'm trying to check if a move is legal for the game Othello. I'm using a for each loop and once (only once) when I use the variable that it's checking for, it gives me a 'cannot be resolved error'. I have bolded where this occurs. Can anyone help? (Yes I know that the code isn't finished yet, I'm trying to get rid of this error first.)</p>

<pre><code>public boolean isLegal(Location loc1)
{
    String currentColor = currentPlayer.getColor();
    boolean isLegal = false;
    int row = loc1.getRow();
    int col = loc1.getCol();
    if(board.isValid(loc1))
    {
        if(board.get(loc1) == null)
        {
            for(Location tempLoc : board.getValidAdjacentLocations(loc1))
            {
                if(!board.get(tempLoc).equals(currentColor))
                {
                    int tempRow = tempLoc.getRow();

                    if((row != tempLoc.getRow()) &amp;&amp; (col == tempLoc.getCol()))
                    {
                        //count up column
                        if(**tempLoc.getRow()** &lt; row)
                        {
                            for(int i = row; i &gt; 1;)
                            {
                                Location tempLoc2 = new Location(i-2, col);
                                if(!board.get(tempLoc2).equals(currentColor))
                                {
                                    i--;
                                }
                                else
                                {
                                    i=-1;
                                    isLegal = true;
                                }   
                            }
                        }
                        //count down column
                        else
                        {
                            for(int i = row; i &lt; 6;)
                            {
                                Location tempLoc2 = new Location(i+2, lcol);
                                if(!board.get(tempLoc2).equals(currentColor))
                                {
                                    i++;
                                }
                                else
                                    i=9;
                                isLegal = true;
                            }
                        }
                    }
                    else if(col != tempLoc.getCol() &amp;&amp; row == tempLoc.getRow())
                    {
                        //count left/right row
                        if(col &gt; tempLoc.getCol())
                        {

                        }
                        else
                    }
                    else
                    {   //count up/right &amp; down/left diag
                        if(1!=0)
                        {

                        }
                        //count up/left &amp; down/right diag
                        else
                    }
                }
            }
        }
    }
    return isLegal;
}
</code></pre>
