Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: "looping" within a command


From   Devra Golbe <[email protected]>
To   [email protected]
Subject   Re: st: RE: "looping" within a command
Date   Wed, 13 Oct 2004 11:41:22 -0400

Thanks Nick-- this solves my problem very neatly. While trace lets me confirm that the `j++' notation increments by 1 from 217, just as it ought, I don't understand the syntax. Can you point me to the section of the manuals where I can read up on this?

Devra

At 10:11 AM 10/13/2004, you wrote:

I take it from this that you always have a -name- and -id-
variable: what differs are the number of -a*-.

If you know N in advance you could build up your -infix-
call like this:

local N = <whatever>
local call "str name 124-143 str id 144-152"
local j = 217
forval i = 1/`N' {
        local call "`call' str a`i' `j++'"
}

then

infix `call' using rawdata.txt

Nick
[email protected]

*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index