Method code for $parse_lib.ask()

[Turn on line numbering]
arg question, @rx;
var ans, def;

[(rx ?= "(yes|y)"), (def ?= "")] = rx;
ans = (> sender().prompt(question).trim() <);
ans ?= def;
if (ans == "@abort")
    throw(~stop, "** Aborted **");
return match_regexp(ans, rx);

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon