Stata 15 help for opts_exclusive

Title

[P] opts_exclusive -- Programmer's utility for mutually exclusive options

Syntax

opts_exclusive "opts" [[option_name] return_code]

Description

opts_exclusive is a programmer's command for displaying an appropriate message and return code when mutually exclusive options are encountered. opts is the list of mutually exclusive options or suboptions. If there are fewer than two options listed in opts, opts_exclusive silently exits with a 0 return code. With more than two options in opts, an error message is displayed and the return code set. For suboptions, option_name indicates the option name. The default return code is 198. return_code specifies a different return code.

Examples

. opts_exclusive "a b" myopt option myopt() invalid; only one of a or b is allowed r(198);

. opts_exclusive "this that other" xyz 274 option xyz() invalid; only one of this, that, or other is allowed r(274);

. opts_exclusive "green yellow red blue" only one of green, yellow, red, or blue is allowed r(198);


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index