Im a pretty advanced Stata user, but have a simple question I cant figure
out: how does one write a *function*, i.e. a program that returns a value,
and that can be called like local y = fct(x), where x and y are numbers or
strings.
This seems it should be available somewhere in the language, yet I?ve
searched in a lot of programming explanations about Stata and never found a
way to write that. FYI, I program extensively in stata, know about r-type
vs. e-type program, and know how to store results to return to main program.
I just don?t know how to write the most simple function form.
Any idea?
Fabrice
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/