Hi everyone,

I'm using a -forval- to populate a local macro that I would use later for labeling values of a variable. My code is as follows:

Code:
forval item = 1/5 {
    local list `"`list' `item' "`""Label for `item'""'""'
    
}
di "`list'"

label define lblvar `list', modify
That results in:

Code:
. di "`list'"
 1 "Label for 1" 2 "Label for 2" 3 "Label for 3" 4 "Label for 4" 5 "Label for 5"

. label define lblvar `list', modify
invalid syntax
r(198);
Then, it seems I get the list I wish to use for labeling, yet I cannot understand the reason of the error from -label define-. I might be using excesive double quotes, I might be mistaken in thinking the local macro `list' is ready to use it in -label define-.

This entry would have the solution to my problem, but I'm not finding it. I will appreciate your suggestions.

Thank you,