View Single Post
  #4  
Old 10-25-2006, 09:43 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,743
Quote:
Originally posted by mike_laff
Hi, thanks for the feedback.

My point here is that subroutine/group steps (the step itself not the steps within) cannot fail as they do nothing. Therefore, is there any point to these failure step settings? I for one, nievely thinking that the subroutine failure settings would do something if the steps within the subroutine failed, wasted hours trying to use these settings. I think it would be helpful to save others the same trouble.
The step could fail if the subroutine being called doesn't exist, an undefined macro is referenced, etc.

Quote:
This does not work if you run any failure steps in the last step. By the time the Exit step gets to evaluate this status, the last failure step will have already modified the %LASTSTEP_STATUS% back to 0 - well, as long as the last failure step itself succeeded! This is exactly where I've had to add custom code (in every stepdone action) along with using my own status macro to be able to track the real status of the build and not including the failure steps. This is very cumbersome and why my previous suggestion would again save a lot of time and effort.

eg.

sub vbld_StepDone()
Set pmacro = Project.Macros("MYLASTSTEP_STATUS")
pmacro.Value = Step.BuildStatus
end sub

along with an exit step status with a build rule as you describe albeit, using my macro...

%MYLASTSTEP_STATUS% does not equal 0

Note. I actually find it simpler not to use the Exit step as you end up with it after every other step. it's much simpler, in this case, just to skip all subsequent actions using the following build rule on them all:

%MYLASTSTEP_STATUS% is equal to 0
You should be able to use FAILSTEP_STATUS in that case.
http://www.visualbuild.com/Manual/systemmacros.htm

Also, as mentioned, if your logic is complex enough to need script events, you should be able to utilize *project-level* script events (i.e., vbld_StepDoneProject) to do it in one place.
http://www.visualbuild.com/Manual/scriptevents.htm
Reply With Quote