Statalist


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

Re: st: locals and programs


From   Tirthankar Chakravarty <[email protected]>
To   [email protected]
Subject   Re: st: locals and programs
Date   Sat, 8 Aug 2009 13:29:06 +0100

<>
If you would like to use the local "TTT" in the program -aaa-, you
need to ensure that -aaa- knows its value. There are a number of ways
you could do this, including passing its value to -aaa- as a scalar.

********************
capture program drop aaa
program define aaa
	syntax, ttt(real )
	di in y  `ttt'
end

capture program drop TT
program define TT
	local TTT = 5
	aaa, ttt(`TTT')
end

TT
********************

T

On Sat, Aug 8, 2009 at 1:08 PM, Paulo Regis<[email protected]> wrote:
> 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/
>



-- 
To every ω-consistent recursive class κ of formulae there correspond
recursive class signs r, such that neither v Gen r nor Neg(v Gen r)
belongs to Flg(κ) (where v is the free variable of r).

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