PDA

View Full Version : Conditional build rule question


Shiamak
04-05-2012, 01:43 PM
How would you do this if you need to match values for multiple MACROS

e.g

%MACO1% = "t" && %MACRO2% = "b"

though above doesnt work!

Any ideas?

kinook
04-05-2012, 01:48 PM
Not sure if you're using MatchesRegex or a string comparison, but put each condition in the expression as needed (i.e., [%MACRO1% = "t" And %MACRO2% = "b"]).

Shiamak
04-05-2012, 02:27 PM
I am using a string comparison, what should be the value selected from drop down below "Build only if .........."?

I tried ([%MACRO1% = "t" And %MACRO2% = "b"]) but Visual build is executing the command even though MACRO1 and MACRO2 do not exists?

Shiamak
04-05-2012, 03:32 PM
what did "i.e," meant in your example in

(i.e., [%MACRO1% = "t" And %MACRO2% = "b"]).

?

kinook
04-05-2012, 04:22 PM
I meant that, for example, you could use a rule like

Build only if
["%MACRO1%" = "t" And "%MACRO2%" = "b"]
is true

to compare the values of two different macros with strings.

If this doesn't help: http://www.kinook.com/Forum/showthread.php?t=927

Please send the details requested at http://www.kinook.com/Forum/showthread.php?t=3044

Shiamak
11-15-2012, 07:18 PM
Hi There,

I am using following condition
[%DEP_SITE%= "A" AND %DEPLOY-HELP% = "B"]

is true

But once VBP starts executing above statement I get following error

Error expanding macros or script in property condexpr: <Error in ? (PerlScript) script code at Line 1, Column 0 (Compilation error)>

any help is appreciated.

BTW: My perl works fine with other macros I have as well as a perl script embeded within VBP.

My VBP version is 7.7

Shiamak
11-15-2012, 07:21 PM
I did try quotes around as well.

Shiamak
11-15-2012, 07:22 PM
Hi There,

I am using following condition
[%DEP_SITE%= "A" AND %DEPLOY-HELP% = "B"]

is true

But once VBP starts executing above statement I get following error

Error expanding macros or script in property condexpr: <Error in ? (PerlScript) script code at Line 1, Column 0 (Compilation error)>

any help is appreciated.

BTW: My perl works fine with other macros I have as well as a perl script embeded within VBP.

My VBP version is 7.7

Litle moe info

When I run single condition e.g. %DEP_SITE%= "A" everythings works fine

kinook
11-15-2012, 10:40 PM
For PerlScript syntax, you need something like

["%DEP_SITE%" eq "A" && "%DEPLOY-HELP%" eq "B"]

http://www.pageresource.com/cgirec/ptut7.htm