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

RE: st: newbie- syntax question


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: newbie- syntax question
Date   Tue, 26 Aug 2003 18:21:40 +0100

Dimitriy V. Masterov
 
> In general, scalars do not need quotes around them.

Quite correct, but that makes the choice sound like 
a question of presentation style. 

A scalar with a temporary name, as in 

tempname foo 
scalar `foo' = 1 

will disappear at the end of the program it belongs to. 

A scalar with a permanent name will persist 
beyond the end of that program, unless dropped. 

scalar foo = 1 

Which is best depends on circumstance. On 
the whole, temporary scalars are perhaps better, 
as they impose less load on memory (usually trivial
in practice) and keep things defined only in a 
relevant namespace (often important in principle 
and practice). 

Nick 
n.j.cox@durham.ac.uk 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index