Statalist


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

st: RE: locals and programs


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: locals and programs
Date   Sat, 8 Aug 2009 14:23:29 +0200

<>

" Local macros exist solely within the program or do-file in
which they are defined." As devertised a couple of times in recent history
of the list. See [P], p. 193.

In any event, the assignment - local aa = TTT- would not do any good for
you. If it was supposed to work, it would have to be - local aa = `TTT'- so
that the content of TTT, not the string "TTT" get stored...



HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Paulo Regis
Sent: Samstag, 8. August 2009 14:09
To: statalist@hsphsun2.harvard.edu
Subject: st: locals and programs

Hi all,

I have which should be a simple question but still I do not manage to
solve it. I simplified the problem as much as possible. If you run the
following code and use the command -TT, you get an error message.

capture program drop aaa
program define aaa
local aa = TTT
display `aa'
end

capture program drop TT
program define TT
local TTT = 5
aaa
end

How can I use the local "TTT" in the programme "aaa". Solving this
issue may save me much time since the code is quite long

Cheers

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