Forum > Beginners

[solved] How can the compile-date be used

(1/2) > >>

Joanna:
Hi everyone elmar69 asked this in chat. Does anyone know the answer? I’m curious too.

 How can the compile-date be used/displayed from compiled code?

dseligo:
See this: https://www.freepascal.org/docs-html/prog/progsu41.html#x48-470001.2.41

cdbc:
Hi
I use it like this:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if S = 'Start' then   LogSvc.LogLn('<- gui='+memGuiVersion+' - fpc='+{$i %fpcversion%}+' @ '+{$i %date%}+' '+{$i %time%}+' - engine='+engver+' - debug ->');Where "engver" & "memGuiVersion" are my own variables...
HTH
Regards Benny

Thaddy:
Benny,
You can also use my version trick for %compilerversion%.
If you are a trunk user, you can determine the patch version.
I am referring to this:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  fpcversion:array[0..255] of char; external name '__fpc_ident';begin  writeln(fpcversion);end.Which prints the real compiler version.
--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$ /mnt/d/versionFPC 3.3.1-15668-ge657d6a07d [2024/05/05] for x86_64 - LinuxThis is only helpful for trunk/main users, I guess. But you always get the date that the compiler is compiled. (Not necessary the patch version)

cdbc:
Hi Thaddy
Cool, thanks, didn't know 'bout this one  8-)
Will come in very handy, as I develop all of my own work in trunk and there, it's nice to know which and when the compiler is from, especially in lieu of the past couple of months' hickups  :D
I only use my 3.2.2 compiler for examples etc. for this forum...
Regards Benny

Navigation

[0] Message Index

[#] Next page

Go to full version