Dear all, I am trying to use AskFunction to perform the following actions (building a list of names):
- Ask the user to enter a name (string)
- Ask if the user wants to enter an additional name (or not)
- If the answer to 2. is yes, then ask to enter a new name. If the answer to 2. is no, then it's done
- While[2., 3] (ask if the user wants to enter an additional name, if "yes" ask to enter the name, if "no" exit the while loop.
I've tried the following (without success) :
f = AskFunction[
Ask[{"name", "Enter a name"} -> "String"];
Ask[{"answer",
"Do you want to add another name ?"} -> {"Yes" -> True,
"No" -> False}];
While[
Ask[{"answer",
"Do you want to add another unit name ?"} -> {"Yes" -> True,
"No" -> False}],
AskAppend["name"];
];
Ask["name"]
];
f[]