Next: mpg-ref-query_input, Previous: mpg-ref-query_class_hook, Up: mpg-bpr [Contents][Index]
query_hook/6
hook:- multifile 'SU_messages':query_hook/6.
'SU_messages':query_hook(+QueryClass, +Prompt, +PromptLines, +Help, +HelpLines, -Answer)
Provides a method of overriding Prolog’s default keyboard based input requests.
term
Determines the allowed values for the atom Answer.
term
A message term.
list of pair
The message generated from the Prompt message term.
term
A message term.
list of pair
The message generated from the Help message term.
term
See QueryClass
This provides a way of overriding Prolog’s default method of interaction. If this predicate fails, then Prolog’s default method of interaction is invoked.
The default method first prints out the prompt, then if the response from the user is not one of the allowed values, then the help message is printed.
It is useful to compare this predicate to user:message_hook/3
, since
this explains how you might use the Prompt, PromptLines,
Help, HelpLines.
An exception raised by this predicate causes an error message to be printed and then the default method of interation is invoked. In other words, exceptions are treated as failures.