Others have explained the apparent anomaly
with -wordcount()-.
I had a go at part of this problem with -selectvars-
on SSC.
It's my impression that -foreach- provides
all the machinery you need otherwise. I would
be wary of reinventing it.
Nick
[email protected]
[email protected]
> I am in the process of writing a short program which will
> repeat multiple
> commands for many variables and combinations of variables.
> In general the
> user spesifies a variable list and commands, and the
> commands are repeated
> through all possible combinations of the variables.
> To run the loops the correct number of times I need to know how many
> variables are listed by the user. I do this through a
> wordcount of the
> variablelist. However, the wordcount seems to be
> unreliable.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/