lcd keypad

At some point, of course, you need to reset fromKeypad to 0.

is this my reset snippet and if not where should this go.

byte fromKeypad = 0;

if its not, what should it be?

I have redone the code

void readKeypad()
{


  char key = keypad.getKey();
  if (key != NO_KEY)   // only be bothered to do something if a key was pressed
  { 
  lcd.setCursor(fromKeypad-1, 1);
  lcd.print(key);
  fromKeypad++;

    switch(key)
    {
    case '*':
      z=0;
      break;
    case '#':
         delay(100); // for extra debounce
      lcd.clear();
      checkPIN();
      break;
      default:
      attempt[z]=key;
      z++;
     

      // playKeyTone();// play a beep to acknowledge that key pressed    
    }
  }

}

it no longer prints on the first row which is good, so i guess with the reset the code should be good.

thanks in advance