I’ve done this before using a switch case statement.
The problem is that param.asStry() cannot equal both “setDat” and “Y” at the same time.
The function is only called once after pressing the return button.
So after you have input “Y” for example, then inside this function because param.asStr() is equal to “Y” not “setDat”
else if (String("setDat") == param.asStr()) {
terminal.clear(); // ONLY RUNS IF param.asStr() == "setData"
terminal.println("Выставление даты:"); // ONLY RUNS IF param.asStr() == "setData"
terminal.println("Продолжить? (Y/n)"); // ONLY RUNS IF param.asStr() == "setData"
if (String("Y") == param.asStr()) { // ONLY RUNS IF param.asStr() == "setData"
terminal.println("день:"); // ONLY RUNS IF param.asStr() == "Y"
Sorry I’m not going to write your code for you because it’s only a snippet, I would need the full function and would need to know exactly what you are trying to achieve.
But if you look at this thread/post:
Then you should be able to work out what you need to do.