Need help how to make decision using terminal widget?

hello i’m new i just want to send data form nodeMcu to terminal in blynk. i try not to use cases statement but the result same as if else statement
this my program

   else if (String("/3") == param.asStr())
  {
    terminal.println(F("-----air temperature-----"));
    terminal.println(F("constant value or flow value"));
    terminal.println(F("type 'yes' or 'no'"));
    terminal.flush();
    if(String("/yes") == param.asStr())
    {
      test_2=1;
    }
    else if(String("/no") == param.asStr())
    {
      test_2=2;
    }
    switch(test_2)
    {
      case 1:
      {
      byte t = dhtA.readTemperature();         
      Blynk.virtualWrite(V3, t); 
      }
      break;

      case 2:
      {
      byte t = dhtA.readTemperature();         
      Blynk.virtualWrite(V3, t); 
      }
      break;
  }

   else 
  {
    terminal.print(F("type'/help' for more info"));
    terminal.println();
  }
  terminal.flush();
} 
}

thank you for helping

I’ve added triple backticks at the beginning and end of your code, so that it displays correctly.
Please do this yourself in future otherwise your code will be deleted.
Triple backticks look like this:
```

Your snippet of code makes no sense, as it begins with an else if statement, so it’s impossible to tell what the rest of the if statement looks like.
However, the rest of your if statements, and your switch case statement are nestled inside this else if statement.
please post your full code (with backticks) and explain the functionality that you’re trying to achieve.

Pete.

what is the question?
are you asking how to branch on terminal input?

I don’t see any difference between the yes and no responses in your code snippet.

what is at the beginning of your snippet ?
did you try the example ?

sory for the mistake

[Unformatted code removed by moderator]

You posted unformatted code again, so it’s been removed.

Please edit your last post and add the code back in, but with triple backticks before and after your code.

Pete.

This has been covered somewhat here: