newbuild.bas Start a new build

[<<<] [>>>]

Whenever the development of a new build is started this program has to be executed. This will increase the build number stored in the file T<build.txt> and also creates the file `buildnum.c'

The souce code of the file `newbuild.bas' is:

on error goto FileOpenError
BuildNumber = Command()
if len(BuildNumber) > 0 then
  BuildNumber += 0
  goto BuildCalculated
endif
BuildCalculated:
fn = 0
FileToOpen = "build.txt"
Doing = "write"
open FileToOpen for output as fn
print#fn,BuildNumber
fn = 0
FileToOpen = "buildnum.h"
open FileToOpen for output as fn
This file was automatically created by newbuild.bas
Each time a new build is to be released this program
is ran and it increments the build number.
"""
close fn
#ifndef SCRIPTBASIC_BUILD
#define SCRIPTBASIC_BUILD """,BuildNumber,"""
#endif
*/
"""
fn = 0
FileToOpen = "pack.cmd"
Doing = "read"
s = t::LoadString(FileToOpen)
If re::m( s,"(.*)SET BUILD=([0-9]+)(.*)") then
  s = re::@$(1) & "SET BUILD=" & BuildNumber & re::@$(3)
  Doing = "write"
  t::SaveString FileToOpen,s
Else
  print "\npack.cmd does not contain build version\n"
Endif
stop


[<<<] [>>>]