Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: Using 'input' in a while loop


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Using 'input' in a while loop
Date   Mon, 4 May 2009 00:04:35 +0200

<>

The behavior reported by Kabs can be replicated via

***
 set obs 10
local i = 1

while `i' < 3 {
inp myvar`i'
5
4
3
end
}
***

Kabs, why do you want to put -input- into a -while- loop which is subject to this very special hazard? Describe what you want to do and I am sure we can circumvent the problem w/o making Stata discriminate between the two -end-s-...

HTH
Martin
_______________________
----- Original Message ----- From: "Kabs Chabalav" <kabs06@gmail.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Sunday, May 03, 2009 11:51 PM
Subject: st: Using 'input' in a while loop


I have an input data command inside a while loop, but when I invoke
'end' to signal the completion of entering data the while loops ends.
Are there any workarounds?

Thank-you.
*
*   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/


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



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