In researching the above question, I came across the this reply from Maarten Buis in 2007:
But its is also possible to capture the lack of option -i()- and substitute within the programme:
Are these two equal approaches to the same end, or does one represent better practice that the other?
If you make the option -i()- optional you have to specify a default
value, so instead of your syntax command you need to write:
syntax [varlist], a(integer) b(real) c(real) d(real) e(real) ///
f(real) g(integer) h(integer) [i(integer 5)]
if you want the default to be 5.
value, so instead of your syntax command you need to write:
syntax [varlist], a(integer) b(real) c(real) d(real) e(real) ///
f(real) g(integer) h(integer) [i(integer 5)]
if you want the default to be 5.
Code:
if (`i' == "") { i = 5 }
Comment