1 01/24/82  Standard subsystem request:  answer
 2 
 3 Syntax:  answer STR {-control_args} request_line
 4 
 5 
 6 Function:  provides preset answers to questions asked by another
 7 request.
 8 
 9 
10 Arguments:
11 STR
12    is the desired answer to any question.  If the answer is more than
13    one word, it must be enclosed in quotes.  If STR is -query, the
14    question is passed on to the user.  The -query control argument is
15    the only one that can be used in place of STR.
16 request_line
17    is any subsystem request line.  It can contain any number of
18    separate arguments (i.e., have spaces within it) and need not be
19    enclosed in quotes.
20 
21 
22 Control arguments:
23 -brief, -bf
24    suppresses printing (on the user's terminal) of both the question
25    and the answer.
26 -call STR
27    evaluates the active string STR to obtain the next answer in a
28    sequence.  The active string is constructed from subsystem active
29    requests and Multics active strings (using the subsystem's execute
30    active request).  The outermost level of brackets must be omitted
31    (ie: "forum_list -changed") and the entire string must be enclosed
32    in quotes if it contains request processor special characters.  The
33    return value "true" is translated to "yes", and "false" to "no".
34    All other return values are passed as is.
35 
36 
37 -match STR
38    answers only questions whose text matches STR.  If STR is surrounded
39    by slashes (/), it is interpreted as a qedx regular expression.
40    Otherwise, answer tests whether STR is literally contained in the
41    text of the question.  Multiple occurrences of -match and -exclude
42    are allowed (see Notes below).  They apply to the entire request
43    line.
44 -exclude STR, -ex STR
45    passes on, to the user or other handler, questions whose text
46    matches STR.  If STR is surrounded by slashes (/), it is interpreted
47    as a qedx regular expression.  Otherwise, answer tests whether STR
48    is literally contained in the text of the question.  Multiple
49    occurrences of -match and -exclude are allowed (see Notes below).
50    They apply to the entire request line.
51 
52 
53 -query
54    skips the next answer in a sequence, passing the question on to the
55    user.  The answer is read from the user_i/o I/O switch.
56 -then STR
57    supplies the next answer in a sequence.
58 -times N
59    gives the previous answer (STR, -then STR, or -query) N times only
60    (where N is an integer).
61 
62 
63 Notes:
64 Answer provides preset responses to questions by establishing an
65 on unit for the condition command_question, and then executing the
66 designated request line.  If any request in the request line calls
67 the command_query_ subroutine (described in the MPM Subroutines) to
68 ask a question, the on unit is invoked to supply the answer.  The on
69 unit is reverted when the answer request returns to subsystem request
70 level.  See "List of System Conditions and Default Handlers" in the MPM
71 Reference Guide for a discussion of the command_question condition.
72 
73 If a question is asked that requires a yes or no answer, and the preset
74 answer is neither "yes" nor "no", the on unit is not invoked.
75 
76 The last answer specified is issued as many times as necessary, unless
77 followed by the -times N control argument.
78 
79 
80 The -match and -exclude control arguments are applied in the order
81 specified.  Each -match causes a given question to be answered if it
82 matches STR, each -exclude causes it to be passed on if it matches STR.
83 A question that has been excluded by -exclude is reconsidered if it
84 matches a -match later in the request line.  For example, the request
85 line:
86 
87 answer yes -match /fortran/ -exclude /fortran_io/ -match /^fortran_io/
88 
89 answers questions containing the string "fortran", except that it does
90 not answer questions containing "fortran_io", except that it does
91 answer questions beginning with "fortran_io".