Recent

Author Topic: [SOLVED] {$I %FPCVERSION%} What does it mean  (Read 1515 times)

BrunoK

  • Full Member
  • ***
  • Posts: 190
  • Retired programmer
[SOLVED] {$I %FPCVERSION%} What does it mean
« on: January 14, 2019, 12:05:02 pm »
I'm trying to figure out what {$I %FPCVERSION%} (like in lazarus ide\AboutFrm line 181)
Code: Pascal  [Select]
  1.   FPCVersionLabel.Caption:= lisFPCVersion+{$I %FPCVERSION%};
the %FPCVERSION% represents and where it comes from.

Thanks.
« Last Edit: January 16, 2019, 11:07:11 am by BrunoK »
Lazarus trunk r. 62137/27.10.2019 (+/- patches regarding TScrollBar, IntitalSetupDialog, Options.Environment options, SearchResults).  Lazarus 3.0.6 raw from svn.
FPC 3.0.4 32 bits. (+heaptrc with leaked ClassName+Revisited TList) , Windows 10 Pro x64 (v. 1903 / 18362.418)

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 917
    • Burdjia
Re: {$I %FPCVERSION%} What does it mean
« Reply #1 on: January 14, 2019, 01:43:06 pm »
It inserts the version number of the FPC compiler as a string to the expression.  You'll get more information in the documentation.

Note that it is different than {$I filename}!
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

BrunoK

  • Full Member
  • ***
  • Posts: 190
  • Retired programmer
Re: [SOLVED] {$I %FPCVERSION%} What does it mean
« Reply #2 on: January 16, 2019, 09:43:07 am »
@Ñuño_Martínez thanks for the first link, I couldn't find it.

Let's say solved.

I have branched 3.0.4 for some tests to a private 3.0.6 branch. I managed to get most 3.0.4 version return to reply 3.0.6 except that  {$I %FPCVERSION%} that still returns 3.0.4.

Will have to dig/hunt a bit more.
Lazarus trunk r. 62137/27.10.2019 (+/- patches regarding TScrollBar, IntitalSetupDialog, Options.Environment options, SearchResults).  Lazarus 3.0.6 raw from svn.
FPC 3.0.4 32 bits. (+heaptrc with leaked ClassName+Revisited TList) , Windows 10 Pro x64 (v. 1903 / 18362.418)

PascalDragon

  • Hero Member
  • *****
  • Posts: 664
  • Compiler Developer
Re: [SOLVED] {$I %FPCVERSION%} What does it mean
« Reply #3 on: January 17, 2019, 12:49:58 pm »
Simply search for 'FPCVERSION' (including the quotes) in the compiler sources which will lead you to a case-clause that uses the version_string function which in turn uses the version_nr, release_nr and patch_nr constants in unit version of the compiler.

BrunoK

  • Full Member
  • ***
  • Posts: 190
  • Retired programmer
Re: [SOLVED] {$I %FPCVERSION%} What does it mean
« Reply #4 on: January 17, 2019, 03:02:00 pm »
@PascalDragon

Thanks.

Indeed it is all there, and is constructed from version_nr+'.'+release_nr+'.'+patch_nr which I had already changed.

It seems that I mixed up my versions. Will figure it out.
Lazarus trunk r. 62137/27.10.2019 (+/- patches regarding TScrollBar, IntitalSetupDialog, Options.Environment options, SearchResults).  Lazarus 3.0.6 raw from svn.
FPC 3.0.4 32 bits. (+heaptrc with leaked ClassName+Revisited TList) , Windows 10 Pro x64 (v. 1903 / 18362.418)