Statalist


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

st: Local with Global macro lists


From   Valerie Orozco <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Local with Global macro lists
Date   Tue, 5 Feb 2008 21:22:33 +0100

Hi,

I have a  problem with macros.
I’m using global macro in some local ones and what I want to obtain don’t work…if someone has an idea.

Example without global macro (which works) :

local Var1vs1 "(g1vs1 : -("
local one "x + y))"
local Var1vs1  "`Var1vs1' `one'"
di "Var1vs1  is `Var1vs1' "   /*it works, I have : Var1vs1  is (g1vs1 : -( x + y)) */

Example with global macro (doesn’t work) :

global N = 1            /*here is my global*/

local Var$Nvs$N "(g${N}vs${N} : -("
local one "x + y))"
local Var${N}vs${N}  "`Var${N}vs${N}' `one'"
di "Var${N}vs${N} is  `Var${N}vs${N}' "   /*Problem I have:Var1vs1 is   x + y)) */

I try to use this sort of program in order to use the nlcom command with a lot of elements…

Thank you very much.

valérie

-------------------------------
Valérie OROZCO
Toulouse School of Economics (INRA-GREMAQ)
21, allée de Brienne
F-31000 Toulouse, France

MF 426
+33 5 61 12 85 91
-------------------------------


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