If I keep the code without -SETting &TEST like you have it, I get this output:
&TEST = Main
&TEST = Include
But if I -SET it, then I get this output:
&TEST = Main
&TEST = Main
Not sure why the initial default value is not being used from the main fex. You think it would take it. Anyone else?
UPDATE: Wait a minute... So, we've got to think about this one. We are -INCLUDEing the second fex INTO the first one. Thus the 2nd -DEFAULT will override the first due to being considered apart of the main fex (like having a 2nd -SET override a first -SET). So with including the included fex, there is technically only 1 fex at run time. That is why your desired scenario will not work. Am I thinking this out correctly?
Tried this all in one fex and I get the first results/output described above:
The first DEFAULTH does set the variable, but the second DEFAULTH does as well. The second DEFAULTH is not considered to be a separate variable as you included it in the first fex.
I personally don't think that this is correct. Having a DEFAULTH should set the variable unless it is already set by a -SET or passed in or a previous DEFAULTH.