|
#1
|
|||
|
|||
Multiple condition evaluation doesn't work
I have VBP 6.7a. I'm trying to evaluate multiple condition in one line by selecting 'build only if macro or expression' option and putting following expression
[Application.FindMacro("NEED_TO_BUILD").Value = "yes" AND Application.FindMacro("IsItCIBuild").Value = "yes"] in the condition field These are obviously mcro values that I've set. From the drop-down, 'is true' is selected. I've also attached the test .bld file I created for this The build seems to completely ignore the condition. I've spend couple of hours on this and I'm getting frustrated BTW, I got the above expression in one post in this forum that was made 3/4 years ago |
#2
|
|||
|
|||
#3
|
|||
|
|||
Here's the attachement
|
#4
|
|||
|
|||
In the project you attached, the NEED_TO_BUILD and IsItCIBuild macros both have a value of no, so the rule evaluates false and the Condition and Log Message steps are skipped. If I change both macro values to yes and rebuild, the rule evaluates true and those steps are built.
If you hold down the Shift key when hovering the mouse cursor over the Build Rule column checkbox in the Project Steps pane, the tooltip will indicate whether the rule evaluates true or false; or hovering over the rule expression in the Step Properties dialog with Shift down will show the evaluated expression (0 = False, non-zero = True). |
#5
|
|||
|
|||
The step is building even with those two macros set at no (the expression should evaluate to 'false and false =false' and the step should be skipped. But the 'log message' step is building and that's what the problem is
|
#6
|
|||
|
|||
Make sure that 'Tools | Application Options | General | Implement nesting of conditional build rules' is checked.
http://www.kinook.com/VisBuildPro/Manual/miscopt.htm |
#7
|
|||
|
|||
It is checked. For all combinations of boolean values (false+true,true+false,false+false, true+true), the coditional step is executing. It should execute only for true+true, since its AND the first three should evaluate to false forcing a skip of the step
|
#8
|
|||
|
|||
You're definitely doing a Rebuild and not Rebuild Selected? And you're getting build output of
Step 'Condition' build rule evaluates true: [Application.FindMacro("NEED_TO_BUILD").Value = "yes" AND Application.FindMacro("IsItCIBuild").Value = "yes"] is true when the macro values are not both yes? The rule has the expected result here -- the Condition and Log Message steps are skipped for all combinations except yes+yes. |
#9
|
|||
|
|||
You are right. Instead of highlighting steps and selecting to rebuild, I just kicked of build from command-line and it worked. Thx for the help
|
|
|