i = warning(string_expʃ, argument1, ..., argument20ʅ);
i = warning(msg_numʃ, argument1, ..., argument20ʅ);
i = warning(string_expʃ, argument1, ..., argument20ʅ)
ʃselect(caption1, fieldname1ʃ, ..., caption5, fieldname5ʅ) ʃdefault(default_option)ʅ ʅ
ʃcase ‖ summaryʅ
ʃdenom = numeric_denomʅ;
The
warning function is similar to the
errmsg function, with the function only having special behavior within a data entry application. If used in a batch or tabulation application, it behaves identically to
errmsg.
The
warning function differs from
errmsg in that it can be used for "soft check" error messages. These messages will not be displayed to the operator when advancing in the case (such as when resuming from a partial save). This can also be useful for information you want to display just once to the operator, such as during initial entry of a field, rather than when the operator is moving from one section to another section, and the field in question lays somewhere in between.
Each argument is sequentially inserted into the warning message. Arguments can be numeric or alphanumeric expressions, but the type of the argument must match the type of the receiving field in the message text (see
errmsg for a complete description of the function's arguments). The maximum number of arguments is 20. If messages are defined via the message number
msg_num, then those messages will be stored in a
message file.
msg_num can be a number or
numeric expression.
If using the
select option, then one of the field arguments must be
continue or you must specify a
default_option, which corresponds to one of the select choices begin presented. This is necessary if advancing within the application, for while the message will not be displayed, the logic will be evaluated, and CSPro needs to know where to go. See below for an example on this usage. If the system is not processing an advance, using
default_option places the focus on the select option chosen when the message is presented. If a
default_option is not given, no button will have the focus.
The function returns the cardinal number of the button pressed. When the select keyword is not used, the function will return 1, as only the "OK" button is presented to the user, corresponding to button #1 ("Cancel" is never presented, and so a code of zero is not possible).
When the select keyword is used, the function returns the sequence number of the button that was pressed, with the first button having the value 1. A maximum of 5 select argument pairs is allowed.
PROC MARITAL_STATUS
if curocc() > 1 and MARITAL_STATUS in 1, 2 /* married, partner */ and SEX = SEX(HEAD) then
warning("Is the sex of this person the same as that of the head of household?")
select("Correct", continue,
"Incorrect: Change this person's sex", SEX,
"Incorrect: Change the head's sex", SEX(HEAD))
default(1); // during an advance, use the first choice: continue;
// if not processing an advance, the focus will be on button 1
endif;