Dear Statalist,
I have functioning code that uses a macro similar to the following:
output:
xxx
yyy
zzz
aaa
bbb
However there are a lot of xxx, yyy and zzz's (diagnostic codes, not available in icd command suite) and in the stata do file I want to wrap the code across multiple lines to make it neater.
Using the /// doesn't work (invalid syntax), and neither does #delimit . I need to have the double quotations when defining the local macro as described here:
https://www.statalist.org/forums/for...-local-command
Output: (nothing)
Is there a way of solving this problem?
My code for a nested loop (as described here: https://www.statalist.org/forums/for...each-and-local) works if I don't create line breaks in the do file
Kind regards,
Ben
I have functioning code that uses a macro similar to the following:
Code:
local lname `" "xxx" "yyy" "zzz" "aaa" "bbb" "'
foreach y of local lname {
display "`y'"
}
xxx
yyy
zzz
aaa
bbb
However there are a lot of xxx, yyy and zzz's (diagnostic codes, not available in icd command suite) and in the stata do file I want to wrap the code across multiple lines to make it neater.
Using the /// doesn't work (invalid syntax), and neither does #delimit . I need to have the double quotations when defining the local macro as described here:
https://www.statalist.org/forums/for...-local-command
Code:
#delimit
local lname `" "xxx" "yyy" "zzz"
"aaa" "bbb" "'
#delimitcr
foreach y of local lname {
display "`y'"
}
Is there a way of solving this problem?
My code for a nested loop (as described here: https://www.statalist.org/forums/for...each-and-local) works if I don't create line breaks in the do file
Kind regards,
Ben

Comment