Macros don't recurse when used as environment variables?

I’m seeing a strange behavior with my variables. Some places they work as expected (such as in the Log Variables Action) but most places they behave oddly:

Here is what I have:
_FB_Dir_Logs=(macro)"%_FB_Dir_Work%\Logs"
_FB_QI_Log=(macro)"%_FB_Dir_Logs%%_FB_QI_LogFile%"

When I display the variables (with DOS command “SET _FB”), here is what I see:
_FB_Dir_Work=C:\NightlyBuilds\Q180
_FB_Dir_Logs=C:\NightlyBuilds\Q180\Logs
_FB_QI_LogFile=Q180-I5040
_FB_QI_Log=\Logs<br>
I would expect _FB_QI_Log to contain “C:\NightlyBuilds\Q180\Logs\Q180-I5040"
It’s like it forgot to resolve those variables.



I also have:
_FB_Dir_W=(macro)”%_FB_Dir_Work%%_FB_QI_LogFile%\Source"

Which comes out like this:
_FB_Dir_W=C:\NightlyBuilds\Q180\Source

So it looks like _FB_Dir_W resolves one variable but not the other.



What would cause this? And yes the variables are set as macros, I’ve checked several times, and saved and reloaded the project and still same problem.
I’m using FB Pro 4.2.0.305
Any ideas?

IMHO, macro environment variables are not a good idea - you don’t know exactly when FB will “resolve” them, leading to possible race conditions between a process that is evaluating the environment variable, and an FB script that is altering the included variables.

I find by far the safest and most reliable method is to avoid macros, and to explicitly set variables when they’re needed. You avoid all kinds of nasty surprises.

Steve

OK, it seems that macro values are only updated when an action item uses them. I don’t think that they are updated if you try to pass them as environment variables.

To work around this, I put a Log Variables action right before my command line and check-mark the variables I need updated.