Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Evaluating return value of script (https://www.kinook.com/Forum/showthread.php?t=4511)

ChrisF 06-10-2010 10:29 AM

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!

kinook 06-10-2010 10:46 AM

If AccessDBResult Then Step.BuildStatus = vbldStepStatFailure

http://www.kinook.com/VisBuildPro/Manual/runscript.htm

ChrisF 06-22-2010 12:23 PM

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!

kinook 06-22-2010 01:00 PM

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."

ChrisF 06-22-2010 01:43 PM

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

kinook 06-22-2010 01:57 PM

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.

ChrisF 06-22-2010 02:47 PM

I see what you mean now by your first reply. Thanks!

ChrisF 06-22-2010 04:14 PM

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


All times are GMT -5. The time now is 01:13 AM.


Copyright © 1999-2023 Kinook Software, Inc.