automatic set the last compilation date

BlitzMax Forums/BlitzMax Programming/automatic set the last compilation date

hub(Posted 2011) [#1]
Hi !
i've you i idea how i can store and display to the screen the last compilation program date ?

yes i now that it's easy to use a const and manually update it. But sure it will be so cool if it could be automatically updated when i compile the program !

thanks !


Brucey(Posted 2011) [#2]
Build scripts are useful in these scenarios...

A scriptable BMK would also be useful, then you could do anything extra that you need - on top of the usual build process.


hub(Posted 2011) [#3]
ideas to do this ? could you post some links ?

Last edited 2011


Hezkore(Posted 2011) [#4]
I've been wondering about this myself, any examples?


Brucey(Posted 2011) [#5]
Something like this is one way to do it...


hub(Posted 2011) [#6]
Hi !
To store the last compilation date :

getdate.bmk
@define GetDate

	version = os.date("%Y/%m/%d")
	file = io.open("version.txt","w")
	file:write(version)
	file:close()

@End


my source code...
SuperStrict

'
' @bmk Include getdate.bmk
' @bmk GetDate 
'

Print "Version = " + LoadText("version.txt")


not work here. (i've created the file version.txt).
i compile the program directly from maxide (CTRL+R) ? Is it my error ?
Thanks !


Brucey(Posted 2011) [#7]
If you are using my BMK, it will work as expected :
Building test
Executing:test.debug.exe
Version = 2011/08/24

Process complete


The official bmk doesn't do much other than compile stuff.


Htbaa(Posted 2011) [#8]
Scriptable BMK huh? BRL should add Lua scripting to it :-)


Brucey(Posted 2011) [#9]
Now there's an idea! ;-)


Htbaa(Posted 2011) [#10]
Lol! Just seen this:http://blitzmax.com/Community/posts.php?topic=90110

You're using Lua with your modified BMK :-D. I did not know that, haha.