This is in Stata 16.1, running on Windows.
Is there some feature of Stata I am missing out on, which is why this is proper behavior?
See below MWE
Code:
cap program drop doesnt_work cap program drop works cap program drop works_but_weird program define doesnt_work syntax, [no_option] if "`no_option'" == "" { disp "no option was called ..." } else { disp "no-option used!" } end program define works syntax, [n_option] if "`n_option'" == "" { disp "no option was called ..." } else { disp "no-option used!" } end program define works_but_weird syntax, [No_option] if "`no_option'" == "" { // note also, case-insensitive (no v.s. No) disp "no option was called ..." } else { disp "no-option used!" } end doesnt_work // prints "no option was called ..." doesnt_work, no_option // prints "no option was called ..." works // prints "no option was called ..." works, n_option // prints "no-option used!" works_but_weird // prints "no option was called ..." works_but_weird, no_option // prints "no-option used!"
0 Response to Options starting with "no" doesn't work, bug or feature?
Post a Comment