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 12-09-2003, 02:13 PM
jdavidi jdavidi is online now
Registered User
 
Join Date: 10-27-2003
Posts: 38
Question Difficulty w/conditional build rule and script expression

Greetings!

I'm having difficulty today with regard to properly evaluting my conditional build rule. It's probably some syntax error either in my build condition expression or the VBScript; I'm hoping someone can point out where I went wrong...

Essentially, I have a macro, CMD_COMPONENTFILENAME; I wish to test it for 3 particular values. If it hits, I want to perform all the child steps, and ignore them if CMD_COMPONENTFILENAME is not in the "list" I provide.

I have set up a Group step, and have checked the 'Build only if Macro or expression' option, and I've set the expression to:

[ValidTP="yay"]

and chose "is true" from the dropdown.

In the Step tab of the Script Editor for this Step, I have the following VBScript:

Option Explicit

Function ValidTP()
Dim jdav
jdav=vbld_AllMacros.Item("CMD_COMPONENTNAME").Valu e
If jdav = "API - TP - LD Disconnect" Or jdav="LogManager" Or jdav = "TestApp" Then
ValidTP = "yay"
Else ValidTP = "boo"
End If
End Function


I'd like to know if ValidTP gets set to "yay" or "boo" and go from there; if I use the Immediate window and evaluate ValidTP when I've set CMD_COMPONENTFILENAME to either of the three strings I'm after, it prints "yay" as expected, and "boo" if anything else.

Is my expression in the conditional build rule field incorrect? Do I need some sort of return command?

I've tried putting just [ValidTP] in the conditional expression (along with "is equal to" "yay") but that always skips the steps.

Hope I was able to describe it clear enough. Thanks in advance for any assitance.

-JDAVIDI
Reply With Quote
  #2  
Old 12-10-2003, 06:53 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Move your ValidTP script function from the Step tab to the Project or Global tab and it should work for you. Code on the Step tab is only processed for step script events (vbld_StepStarting, etc.). We could probably update the docs to make this a little more clear.
Reply With Quote
  #3  
Old 12-11-2003, 02:36 PM
jdavidi jdavidi is online now
Registered User
 
Join Date: 10-27-2003
Posts: 38
Smile Success!

Thanks very much, that did the trick!
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:13 PM.


Copyright © 1999-2023 Kinook Software, Inc.