[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: Odd results from wordcount
You should use:
local antvar: word count `varlist'
instead of the wordcount() function. You must be using the non-SE version
of Stata which will truncate string function evaluations (involving an equal
sign) to 80 characters.
----- Original Message -----
Sent: Friday, December 19, 2003 8:54 AM
Subject: st: Odd results from wordcount
> Dear listers.
> 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. The program
> code and a transcript from part of the trace which illustrates the error,
> Part of the program code looks like this:
> program redo
> syntax [varlist] [if] [in],cmds(namelist) [lhs(varlist)] [all] [savegraph]
> noisily display "varlist: `varlist'"
> noisily display "cmds: `cmds'"
> local antvar=wordcount("`varlist'")
> noisily display "antvar: `antvar'"
* For searches and help try: