Logtalk reference manual
Built-in method: question_hook/6
Contents > Reference Manual > Built-in Methods > question_hook/6

## question_hook/6

#### Description

    question_hook(Question, Kind, Component, Tokens, Check, Answer)

User-defined hook method for intercepting asking a question, declared in the `logtalk` built-in object as a public, multifile, and dynamic predicate. This hook method is automatically called by the `ask_question/5` method. When the call succeeds, the `ask_question/5` method assumes that the question have been successfully asked and replied.

#### Template and modes

    question_hook(+nonvar, +nonvar, +nonvar, +list(nonvar), +callable, -term)

#### Meta-predicate template

    question_hook(*, *, *, *, 1, *)

#### Errors

`(none)`

#### Examples

    :- multifile(logtalk::question_hook/6).
    :- dynamic(logtalk::question_hook/6).

    % use a pre-defined answer instead of asking the user
    logtalk::question_hook(upper_limit, question, my_app, _, float, 3.7).

#### See also

`ask_question/5`, `question_prompt_stream/4`
`message_hook/4`, `message_prefix_stream/4`, `message_tokens//2`, `print_message/3`, `print_message_tokens/3`, `print_message_token/4`