Ehh.. since I only want a buildnumber per project (exe) and not per file I just made my own version to add a buildnumber. I make dayly backups of the project. At least errors have now no offset.
Code:
; This works fine if you devellop each program (exe) in a seperate directory
;
; Put in the main file code file of the project you want to Compile/Run:
; IncludeFile "build_info.pbi"
;
; This program generates/updates the pbi file
; Add buildnumber.exe via menu Tools : Config tools
;
; Commandline: browse to the directory where you stored the executable
; example: C:\Program Files\PureBasic\AddOn\buildnumber.exe
; Arguments : "%PATH"
; Name : BuildNumber
; Event to trigger the tool: Before Compile/Run
; Options: Wait until tool quits
; Options: Hide Tool from the Main menu
IncludeFile "build_info.pbi"
#STR_BUILD_NUMBER = "#BUILD_NUMBER = "
#STR_BUILD_DATE = "#BUILD_DATE = "
#BUILD_NUMBER_FILE = "build_info.pbi"
#DATE_MASK = " %dd-%mm-%yyyy %hh:%ii "
Global path$
Global bnbr.l
bnbr = 0
path$=Trim(ProgramParameter())
; MessageRequester("Debug information " + Str(#BUILD_NUMBER), path$, 0)
If path$="" Or Len(path$)<3
MessageRequester("Build information "+Str(#BUILD_NUMBER), "Save the file just once to get Build information.", 0)
Else
If ReadFile(1,path$+#BUILD_NUMBER_FILE) <> 0
in$=ReadString()
If Left(in$,Len(#STR_BUILD_NUMBER)) = #STR_BUILD_NUMBER
bnbr = Val(Trim(Right(in$,Len(in$)-Len(#STR_BUILD_NUMBER) + 1))) + 1
Else
bnbr = 1;
EndIf
CloseFile(1)
DeleteFile(path$+#BUILD_NUMBER_FILE)
EndIf
CreateFile(0,path$+#BUILD_NUMBER_FILE)
WriteStringN(#STR_BUILD_NUMBER+Str(bnbr))
WriteStringN(#STR_BUILD_DATE+Chr(34)+FormatDate(#DATE_MASK,Date())+Chr(34))
CloseFile(0)
EndIf
End