Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-10-2010, 10:29 AM
ChrisF ChrisF is online now
Registered User
 
Join Date: 12-09-2009
Posts: 67
Evaluating return value of script

Using VBPro v7.2

I have a Run Script step, which has a VBScript. The VBScript runs a function in a Access DB, and the Access DB function returns a -1 on fail, an 0 on pass. How can I make my Run Script step use the return value of my Access DB function, so I can evaluate a pass/fail condition on the Run Script step? Thanks!
Reply With Quote
  #2  
Old 06-10-2010, 10:46 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
If AccessDBResult Then Step.BuildStatus = vbldStepStatFailure

http://www.kinook.com/VisBuildPro/Manual/runscript.htm
Reply With Quote
  #3  
Old 06-22-2010, 12:23 PM
ChrisF ChrisF is online now
Registered User
 
Join Date: 12-09-2009
Posts: 67
I'm usually good at reading between the lines, but I wasn't sure on this one. So where would I put the above If statement? Also the link you gave talked about evaluating a vbld_* function status, but couldn't make out with the instructions either. Thanks!
Reply With Quote
  #4  
Old 06-22-2010, 01:00 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
You said "I have a Run Script step, which has a VBScript. The VBScript runs a function in a Access DB, and the Access DB function returns a -1 on fail, an 0 on pass." So the If statement (obviously adjusted to actually check the result of your function) would go in the VBScript code after the call to the Access DB function.

I was referring to the help in that topic which states "The step's BuildStatus property can be set to vbldStepStatFailed in the script code to signal failure of the step."
Reply With Quote
  #5  
Old 06-22-2010, 01:43 PM
ChrisF ChrisF is online now
Registered User
 
Join Date: 12-09-2009
Posts: 67
So I have something like this in the VBScript that's in the Run Script step?

if MyAccessDBFunction == 0 then
Step.BuildStatus = vbldStepStatSucceeded
else
Step.BuildStatus = vbldStepStatFailed

Last edited by ChrisF; 06-22-2010 at 01:55 PM.
Reply With Quote
  #6  
Old 06-22-2010, 01:57 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
That works too (except = is VBScript equality, not ==). -1 (non-zero) equates to True in VBScript, and succeeded is the default status, so

If MyAccessDBResult Then Step.BuildStatus = vbldStepStatFailure

should also work.
Reply With Quote
  #7  
Old 06-22-2010, 02:47 PM
ChrisF ChrisF is online now
Registered User
 
Join Date: 12-09-2009
Posts: 67
I see what you mean now by your first reply. Thanks!
Reply With Quote
  #8  
Old 06-22-2010, 04:14 PM
ChrisF ChrisF is online now
Registered User
 
Join Date: 12-09-2009
Posts: 67
Quote:
Originally posted by kinook
That works too (except = is VBScript equality, not ==). -1 (non-zero) equates to True in VBScript, and succeeded is the default status, so

If MyAccessDBResult Then Step.BuildStatus = vbldStepStatFailure

should also work.
This wored!Thanks again.

If MyAccessDBResult Then Step.BuildStatus = vbldStepStatFailed
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 04:51 AM.


Copyright © 1999-2023 Kinook Software, Inc.