Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Delimiter in a loop


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Delimiter in a loop
Date   Tue, 16 May 2006 20:46:12 +0100

Juanita has given a good answer. 

Another one is why use a delimiter at all? 

I realise that your example is schematic 
and that your real code may be much more
complicated. But even if you have very long 
lines you can use /// to join one line to
another. 

That leads to less fiddling around, long run. 

Nick 
[email protected] 

Riano, Juanita
 
> # delimit ;
> foreach v of var var1 var2 var3 {;
> 	do something;
> 	};

Thomas Speidel
 
> Is there a way to use the " ; " delimiter in a loop?  For 
> example, doing
> something on the line of:
> 
> # delimit ;
> foreach v of var var1 var2 var3 {
> 	do something
> 	}
> ;
>  
> Would return the error that the code "follows on the same line as open
> brace". 
> 

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