I have two local macros that are lists of variables. For example, X = A B C D and Y = 1 2 3 4.
I want a loop that will refer to the same position of each local macro list at the same time.
I don't want a nested loop like,
foreach i in X {
which will create 16 variables.
I want something like,
foreach i in [X,Y] {
which then creates A_1, B_2, C_3, D_4.
Also, I'd like a general solution to this, because `i' and `j' could be anywhere inside the loop.
Thank you in advance.
I want a loop that will refer to the same position of each local macro list at the same time.
I don't want a nested loop like,
foreach i in X {
foreach j in Y {}
gen `i'_`j'=0
}
which will create 16 variables.
I want something like,
foreach i in [X,Y] {
gen `i'_`j'=0}
which then creates A_1, B_2, C_3, D_4.
Also, I'd like a general solution to this, because `i' and `j' could be anywhere inside the loop.
Thank you in advance.
Comment