Statalist


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

RE: st: RE: user input as scalar value


From   David Kantor <kantor.d@att.net>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: RE: user input as scalar value
Date   Thu, 26 Jun 2008 14:28:39 -0400

At 12:52 PM 6/26/2008, Rajesh wrote:
Hi,

Thanks all for your suggestions..

And thanks very much Joseph for that clarification. But,  Does that depend
anyway on whether you use _request(foo) or _request(_ foo)

See below,

1. with _request(foo)

. display in smcl as input "Enter value for foo: " _request(foo)
Enter value for foo: . n

. display in smcl as text "local " as result "`foo'"
local

. display in smcl as text "global " as result "$foo"
global n

.
end of do-file

2. with _request(_foo)

[...]

. display in smcl as input "Enter value for foo: " _request(_foo)
Enter value for foo: . m

. display in smcl as text "local " as result "`foo'"
local m

. display in smcl as text "global " as result "$foo"
global n
[...]
You have discovered that a global macro that begins with an underscore is a local. That is documented in [P] macro.

--David

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