For example I am writing a program where an argument is optional as long as option1 hasn't also been given. If option1 has been given I want the program to produce an error if the argument has not been given.
A work around is to set the value to one that would be implausible for the user to enter but this does not seem ideal. Is there a better way to do this?
Code:
prog define foo
syntax, [option1, a_number(integer -99999)]
if `a_number' == -99999 & "`option1'" != "" {
di as error "a_number must be provided if option1 is specified"
}
end
0 Response to Is it possible to not set values of optional integer arguments with the syntax command
Post a Comment