For every action, you can set a condition "build only if macro or expression ... is true/false/defined/undefined/etc."
Now, occasionally I want to build a step if some macro (let's say "UnsureMacro") is either not defined, or if it's true.
To pull this off I've been messing with a temporary macro "DO_IT" which I first set to true (always), and then (in a separate set macro action) set it to %UnsureMacro% if UnsureMacro is defined.
Then in the actual action, I enable the condition "only if %DO_IT% is true".
This works, but it feels kinda clumsy. Is there some script expression in which I can combine this, so I don't have to mess with a temp macro and separate actions?
I tried stuff like this:
Code:
[((vbld_AllMacros()("UnsureMacro")) Is Nothing) OR ((vbld_AllMacros()("UnsureMacro"))<>"0")]
But that still results in an error if UnsureMacro is not defined.
If I write a complete script for this, I can do it, but is there perhaps a neat tight single expression that does the same?