Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-17-2004, 05:17 PM
charlesm charlesm is online now
Registered User
 
Join Date: 06-03-2004
Location: San Diego
Posts: 7
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?
Reply With Quote
  #2  
Old 11-17-2004, 05:24 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
Yep. Use script in the expression field (excuse the J-Script):

[! %Macro1% && "%macro2%" == 1]

and select "is true" from the test list box.
Reply With Quote
  #3  
Old 11-17-2004, 07:40 PM
charlesm charlesm is online now
Registered User
 
Join Date: 06-03-2004
Location: San Diego
Posts: 7
The script always seems to return as false, I have modified the expression multiple ways and it always seems to return false... strange
Reply With Quote
  #4  
Old 11-17-2004, 09:45 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
Post an example of the failing test and typical values of any macros you are using
Reply With Quote
  #5  
Old 11-18-2004, 12:33 PM
charlesm charlesm is online now
Registered User
 
Join Date: 06-03-2004
Location: San Diego
Posts: 7
The expression is !%isRebuild% && %vBuild% == 1


and it checks to see if it is true

Attached is an example.

Thanks for the help!
Reply With Quote
  #6  
Old 11-18-2004, 03:25 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
Did you mean:

[!%isRebuild% && %vBuild% == 1]

The [] are what VBP uses to know that it is script.

There in no attachment to your post.
Reply With Quote
  #7  
Old 11-18-2004, 03:29 PM
charlesm charlesm is online now
Registered User
 
Join Date: 06-03-2004
Location: San Diego
Posts: 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
Attached Files
File Type: bld sample.bld (671 Bytes, 1540 views)
Reply With Quote
  #8  
Old 11-18-2004, 03:37 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
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.
Reply With Quote
  #9  
Old 11-18-2004, 03:44 PM
charlesm charlesm is online now
Registered User
 
Join Date: 06-03-2004
Location: San Diego
Posts: 7
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>
Reply With Quote
  #10  
Old 11-18-2004, 03:44 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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).
Reply With Quote
  #11  
Old 11-18-2004, 03:49 PM
charlesm charlesm is online now
Registered User
 
Join Date: 06-03-2004
Location: San Diego
Posts: 7
Smile 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....
Attached Files
File Type: bld sample.bld (664 Bytes, 1607 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 07:19 AM.


Copyright © 1999-2023 Kinook Software, Inc.