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! |
If AccessDBResult Then Step.BuildStatus = vbldStepStatFailure
http://www.kinook.com/VisBuildPro/Manual/runscript.htm |
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!
|
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." |
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 |
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. |
I see what you mean now by your first reply. Thanks!
|
Quote:
If MyAccessDBResult Then Step.BuildStatus = vbldStepStatFailed |
All times are GMT -5. The time now is 06:34 PM. |
Copyright © 1999-2023 Kinook Software, Inc.