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)
-   -   Fail Build from VBScript (https://www.kinook.com/Forum/showthread.php?t=1709)

modernrocketry 04-27-2006 12:25 PM

Fail Build from VBScript
 
I am using the tlbimp command in a build and have noticed that when an error occurs, the build continues.

So I cobbled together a vb script to parse the LASTSTEP_OUTPUT and look for an error (TlbImp : error)
Everything works as planned, except stopping the build if an error is found.

I thought "Step.BuildStatus = vbldStepStatFailed" would stop the set, but it reports succeeded and keeps going.
What am I doing wrong?

Code:

output = Split(Application.Macros(vbldMacroSystem)("LASTSTEP_OUTPUT"), vbCrLf)
For i = 0 To UBound(output)
    strSearchThis = output(i)
    if instr(strSearchThis, "TlbImp : error") > 0 then
        Builder.LogMessage "TLB ERROR FOUND"
        Step.BuildStatus = vbldStepStatFailed
        Exit for
    end if
   
Next


kinook 04-27-2006 02:58 PM

Where is the code, in the step's vbld_StepDone event? That should work (as long as 'Continue building' is not checked on the General tab). Please ZIP and send or post:
1) The info from Help | About | Install Info
2) A .bld file that reproduces the problem
3) A build log file

modernrocketry 04-27-2006 03:59 PM

My error.
I had the above code inserted as a child step.
Once I moved it to the parent step in the correct event -- worked like a charm

Thanks for the quick turn around
MR

wellilein 06-18-2010 03:52 AM

Similar for actions
 
I had a similar issue for a custom action.

Once I moved the code inside
Code:

Function vbld_BuildStep()
I was able to let the action fail by setting
Code:

vbld_BuildStep = vbldStepStatFailed


All times are GMT -5. The time now is 03:55 AM.


Copyright © 1999-2023 Kinook Software, Inc.