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

st: loop trouble


From   "Huiber Gabi (nat1gxh)" <[email protected]>
To   [email protected]
Subject   st: loop trouble
Date   Fri, 9 May 2003 11:50:13 -0400

Hello Statalist,

I'm trying to run a loop like this:

use "`mytempfile'"
local x _N
forvalues i(1)`x' {
[do stuff]
}

This loop is identical to the one in the Programming Manual, p. 106, where
the loop 

local n 3
forvalues i(1)`n' {
[do stuff]
}

will run just fine three times. Mine claims that the syntax is invalid. Any
ideas?

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