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

RE: st: newbie- syntax question


From   "Nick Cox" <[email protected]>
To   <[email protected]>
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 
[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