how to save keypad inputs

hi i need to get 3 values from user and save them to use when i need them here is a part of my code:

void loop() { char customKey = kpd.getKey ();

if ( customKey ){

Lcd.print(customKey);

} String first = String(customKey);

if(first == "A" ){

Lcd.clear();

Lcd.setCursor(0,0);

Lcd.print("Enter length");

Lcd.setCursor(0,1);

Lcd.print("length:");

"L"==customKey;

} String second = String(customKey);

if(second == "B" ){

Lcd.clear();

Lcd.setCursor(0,0);

Lcd.print("Enter width");

Lcd.setCursor(0,1);

Lcd.print("width:");

"W"==customKey;

here i need to save L and W but the problem is customkey is keep Changing and in this code w is equal to L and it shouldn't be! i want to get the first number from user, save it in L then get the next one what should i do?

From "Read this before posting a programming question"

Item 6:

Post your complete sketch (program code)! If you don’t you waste time while people ask you to do that.
When you post your code put it between

 ...

tags. You can do that by hitting the </> button above the posting area.

void loop()
{
  char customKey = kpd.getKey ();

  if ( customKey ){

    Lcd.print(customKey);

    }
 String first =  String(customKey);

 if(first == "A" ){

   Lcd.clear();

   Lcd.setCursor(0,0);

   Lcd.print("Enter length");

   Lcd.setCursor(0,1);

   Lcd.print("length:");

   "L"==customKey;

    }
    String second =  String(customKey);

 if(second == "B" ){

   Lcd.clear();

   Lcd.setCursor(0,0);

   Lcd.print("Enter width");

   Lcd.setCursor(0,1);

   Lcd.print("width:");

   "W"==customKey;

What is this line and a similar one for "W" supposed to do? " "L"==customKey;

Paul

I want to save length in L and width in W I also cant use switch case because the inputs are not predictable!

I want to save length in L and width in W

Then, it would make sense to save the value in customKey ONLY when there IS a value in customKey. You already check that there IS a value in customKey, and take some action if there is. Then, you (stupidly) try to save the value even if there is no value. Why would you do that?

   "L"==customKey;

What were you smoking when you typed this mess?

Are you using the 'A' key and 'B' key to select which value you are about to enter?

void prompt(char *value)
{
  Lcd.clear();
  Lcd.setCursor(0, 0);
  Lcd.print("Enter ");
  Lcd.print(value);
  Lcd.setCursor(0, 1);
  Lcd.print(value);
  Lcd.print(":");
}


void loop()
{
static unsigned int value = 0;


  char customKey = kpd.getKey ();


  if ( customKey != NO_KEY )
  {
    Lcd.print(customKey);
    switch (customKey)
    {
      case 'A':
        prompt("length");
        break;


      case 'B':
        prompt("width");
        break;


      case '0'..'9':
        value *= 10;
        value += customKey - '0';
        break;
    }
  }