PDA

View Full Version : Duplicate build number after increment


ktak
09-16-2009, 05:10 PM
I am using VBP 6.5 and Window's Scheduled Task to trigger an automatic build. Within the build, there is a step that increments the build number and emails us with that information after a successful build.

The problem is that we often see duplicate build numbers.
ie.
.....
build 390 Success.
build 391 Success.
build 391 Success.
build 392 Success.
build 394 Success.
build 395 Success
......

This duplication occurs quite often, even when the builds are completing normally.

Below is the code for the incrementation step.

' retrieve the current BUILD_NUM macro from the global macros
' collection
Set objMacro = Application.Macros(vbldGlobal).Item("BUILD_NUM")

If objMacro Is Nothing Then
' if the macro doesn't exist yet, initialize to one
Application.Macros(vbldGlobal).Add "BUILD_NUM", "1"
Set objMacro = Application.Macros(vbldGlobal).Item("BUILD_NUM")
Builder.LogMessage "Incremented BUILD_NUM macro to " & objMacro.Value
Else
' otherwise increment the value
objMacro.Value = Clng(objMacro.Value)+1
Builder.LogMessage "Incremented BUILD_NUM macro to " & objMacro.Value
End If


Anyone else experience this issue?

kinook
09-22-2009, 07:18 AM
http://www.kinook.com/Forum/showthread.php?threadid=3044