Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-20-2005, 04:51 PM
Ken Ken is online now
Registered User
 
Join Date: 05-08-2003
Posts: 20
Return Pass/Fail from a function call

How do I return a Pass/Fail from a funciton call?
Reply With Quote
  #2  
Old 10-21-2005, 08:05 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
What do you mean by function call? A script function? What language?
Reply With Quote
  #3  
Old 10-21-2005, 10:12 AM
Ken Ken is online now
Registered User
 
Join Date: 05-08-2003
Posts: 20
Whoops,
When I call to a subroutine call and I want to return a fail.

Ken
Reply With Quote
  #4  
Old 10-21-2005, 10:26 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
You don't typically return success/failure from a subroutine -- if a step of the subroutine fails, the build will automatically stop on that step (after building failure steps if specified) so that the problem can be corrected and the build continued. If that doesn't work, please describe your situation and needs in a little more detail, and we may be able to provide some suggestions.
Reply With Quote
  #5  
Old 10-21-2005, 11:45 AM
Ken Ken is online now
Registered User
 
Join Date: 05-08-2003
Posts: 20
OK,
I am building over a 100 different files and I want to record at the highest level of subroutines when it fails. So when I execute a "Build File" subroutine call(Which calls other subroutines), it's going to pass/fail. On ether case, I would like it to continue so I will have the "Ignore Failures" checked.

But I would like to see if it pass/failed at the higher levels by the result of that subroutine call. I would expect that I need to force the result in LastStepStatus so when it returns this value has the correct Pass/Fail value in it.

Ken
Reply With Quote
  #6  
Old 10-22-2005, 04:17 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The LASTSTEP_STATUS macro will contain the build status of the last completed step (the last step in a subroutine when returning from a subrouting). If your subroutine has multiple steps marked to ignore failure and you want to know if any of them failed to build, there are a couple ways to approach it:

1) After the Subroutine Call step, add a Run Script step that uses the VBP object model to locate the subroutine and check the BuildStatus property of each step.

2) In the vbld_StepDone script event of each step within the subroutine, check the Step.BuildStatus property and create/update a temporary macro (i.e., SUB_FAILED) if the step failed. Then after calling the subroutine, use that temporary macro value to determine if the subroutine failed.

The attached sample demonstrates both methods.

Note: This sample project requires VBP v6.
Attached Files
File Type: bld subfailure.bld (3.9 KB, 1550 views)
Reply With Quote
Reply


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 09:30 AM.


Copyright © 1999-2023 Kinook Software, Inc.