#1
|
|||
|
|||
Multiple conditional rules?
I would like to have multiple conditional rules before building a group of steps. Is that possible? For instance, do this group of steps if macro1 = False and macro2=1.
Any thoughts? |
#2
|
|||
|
|||
Yep. Use script in the expression field (excuse the J-Script):
[! %Macro1% && "%macro2%" == 1] and select "is true" from the test list box. |
#3
|
|||
|
|||
The script always seems to return as false, I have modified the expression multiple ways and it always seems to return false... strange
|
#4
|
|||
|
|||
Post an example of the failing test and typical values of any macros you are using
|
#5
|
|||
|
|||
The expression is !%isRebuild% && %vBuild% == 1
and it checks to see if it is true Attached is an example. Thanks for the help! |
#6
|
|||
|
|||
Did you mean:
[!%isRebuild% && %vBuild% == 1] The [] are what VBP uses to know that it is script. There in no attachment to your post. |
#7
|
|||
|
|||
I get a parse error when I put the brakets in...
Error expanding macros in property condexpr: <Error at Line 1, Column 1 (Syntax error) Code: !False && 1 == 1> trying the attachment again |
#8
|
|||
|
|||
The [] are required. You are getting an error because False is not a value that can be inverted with !. %isRebuild% should be set to 0 (false) or a non-zero value (typically -1).
Tip: if you pause your mouse cursor over the expression a tool tip will show the expression with macros expanded. Mega tip: if you hold down a shift key and pause your mouse cursor over and expression containing script the tool tip will show the result of evaluating the script. |
#9
|
|||
|
|||
I updated the expression to look like this:
[!%isRebuild% && %vBuild% == 1] and changed the isRebuild macro to 0 and -1 and still get the following results: Error expanding macros in property condexpr: <Error at Line 1, Column 1 (Syntax error) Code: !-1 && 1 == 1> |
#10
|
|||
|
|||
Also, as was mentioned, this code is JScript syntax, requiring that you set JScript as your default script language (Tools | Options | General). The equivalent VBScript would be
[Not %isRebuild% And %vBuild% = 1] (assuming that those macros contain values that can be interpreted as boolean/numeric, respectively). |
#11
|
|||
|
|||
It works!
That fixed it, I am using VBScript as my default language and used [Not %isRebuild% And %vBuild% = 1] to get the desired results. Thank you for the help!!!!!!
For those interested (I hate when forums don't give you the conculsion), here it the final script.... |
|
|