Compare what user entered to the specific value. If they mismatch - ask again. Also there are several utility methods in %Prompt class for number/yes-no/etc input:
- GetNumber
- GetString
- GetYesNo
- GetArray - Prompt for a number or entry in a displayed menu. Returns the selected item.
- GetMenu - Prompt for a number in a displayed menu.
- GetMore - Prompt for More or Quit.
For example:
do ##class(%Prompt).GetYesNo("Enter Yes or No:", .result)User can input only Yes (Y) or No (N). result variable would hold 1 or 0.
You can also check %Prompt code and write something based on that.
- Log in to post comments
