Question

Imagine you have a list of variable names A,B,C,D,E saved in a local macro:

loc l1 "A B C D E"

You also have a different list of variable names A,C saved in a different macro:

loc l2 "A C"

How would you get the (set) difference of those, namely, a list of variable names B,D,E?

Was it helpful?

Solution

local l1  "A B C D E"
local l2 "A C"
local l3 : list l1 - l2
di "`l3'"

for more see: help extended fcn, and especially help macrolists.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top