|
#1
|
|||
|
|||
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! |
#2
|
|||
|
|||
If AccessDBResult Then Step.BuildStatus = vbldStepStatFailure
http://www.kinook.com/VisBuildPro/Manual/runscript.htm |
#3
|
|||
|
|||
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!
|
#4
|
|||
|
|||
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." |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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. |
#7
|
|||
|
|||
I see what you mean now by your first reply. Thanks!
|
#8
|
|||
|
|||
Quote:
If MyAccessDBResult Then Step.BuildStatus = vbldStepStatFailed |
|
|