• Lazarus and FPC

    From Dan Richter@1:317/3 to All on Mon Jun 11 19:53:20 2018
    Hi All,

    I know there aren't many Pascal programmers around anymore, but I thought I'd ask a question here, as I've been unable to find any info on the internet.

    I've been writing some programs in Pascal, using Lazarus 1.8.2 with FPC
    3.0.4, running under Ubuntu 18.04.

    Is there a way to use the Lazarus version number set up in the Project
    Options -=> Version Info, as a variable in the code?

    Right now, I've just been changing the version number in both Lazarus, and as
    a CONST in my programs. There have been a couple times, where I forget one of them, and it causes confusion, at least on my part... :)

    Thanks for any assistance.


    ---

    Black Panther
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS (RCS)
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (1:317/3)
  • From Gene Buckle@1:138/142 to Dan Richter on Tue Jun 12 07:20:08 2018
    Re: Lazarus and FPC
    By: Dan Richter to All on Mon Jun 11 2018 07:53 pm

    Hi All,

    I know there aren't many Pascal programmers around anymore, but I thought I' ask a question here, as I've been unable to find any info on the internet.

    I've been writing some programs in Pascal, using Lazarus 1.8.2 with FPC 3.0.4, running under Ubuntu 18.04.

    Is there a way to use the Lazarus version number set up in the Project Options -=> Version Info, as a variable in the code?

    Right now, I've just been changing the version number in both Lazarus, and a a CONST in my programs. There have been a couple times, where I forget one o them, and it causes confusion, at least on my part... :)

    Dan, take a look here: http://forum.lazarus.freepascal.org/index.php?topic=1243 5.0

    g.
    --- SBBSecho 2.27-Win32
    * Origin: The Retro Archive (1:138/142)
  • From Vince Coen@2:250/1 to Dan Richter on Tue Jun 12 13:55:33 2018
    Hello Dan!

    Monday June 11 2018 19:53, you wrote to All:

    Hi All,

    I know there aren't many Pascal programmers around anymore, but I
    thought I'd ask a question here, as I've been unable to find any info
    on the internet.

    I've been writing some programs in Pascal, using Lazarus 1.8.2 with
    FPC 3.0.4, running under Ubuntu 18.04.

    Is there a way to use the Lazarus version number set up in the Project Options -=> Version Info, as a variable in the code?

    Right now, I've just been changing the version number in both Lazarus,
    and as a CONST in my programs. There have been a couple times, where I forget one of them, and it causes confusion, at least on my part... :)

    Thanks for any assistance.


    If you use the configure;make build facilty you can create version, build numbering within and just change the vars in configure.in before running the build script.

    AS for the info in a program is this for pickup during running or at the build stage. If the later that is simple enough even if you issue a export version-var before running in a script.

    If the former you will need to check the fpc docs to see if there is a function
    for it or write your own or again use an exported vars for your program to
    pick up.

    I do use the developed program version for displays and the printed reports but
    the make script does make use of the compiler version sometimes but not often as I am more concerned with the platform.


    Vince

    --- Mageia Linux v5.1/Mbse v1.0.7.6/GoldED+/LNX 1.1.501-b20150715
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)
  • From Vince Coen@2:250/1 to Dan Richter on Tue Jun 12 13:55:33 2018
    Hello Dan!

    Monday June 11 2018 19:53, you wrote to All:

    Hi All,

    I know there aren't many Pascal programmers around anymore, but I
    thought I'd ask a question here, as I've been unable to find any info
    on the internet.

    I've been writing some programs in Pascal, using Lazarus 1.8.2 with
    FPC 3.0.4, running under Ubuntu 18.04.

    Is there a way to use the Lazarus version number set up in the Project Options -=> Version Info, as a variable in the code?

    Right now, I've just been changing the version number in both Lazarus,
    and as a CONST in my programs. There have been a couple times, where I forget one of them, and it causes confusion, at least on my part... :)

    Thanks for any assistance.


    If you use the configure;make build facilty you can create version, build numbering within and just change the vars in configure.in before running the build script.

    AS for the info in a program is this for pickup during running or at the build stage. If the later that is simple enough even if you issue a export version-var before running in a script.

    If the former you will need to check the fpc docs to see if there is a function
    for it or write your own or again use an exported vars for your program to
    pick up.

    I do use the developed program version for displays and the printed reports but
    the make script does make use of the compiler version sometimes but not often as I am more concerned with the platform.


    Vince

    --- Mageia Linux v5.1/Mbse v1.0.7.6/GoldED+/LNX 1.1.501-b20150715
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)
  • From Dan Richter@1:317/3 to Gene Buckle on Tue Jun 12 12:08:18 2018
    On 06/12/18, Gene Buckle said the following...

    Is there a way to use the Lazarus version number set up in the Project Options -=> Version Info, as a variable in the code?

    Dan, take a look here: http://forum.lazarus.freepascal.org/index.php?topic=1243 5.0

    How did I not see that in my searching? Thank you.


    ---

    Black Panther
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS (RCS)
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (1:317/3)
  • From Dan Richter@1:317/3 to Vince Coen on Tue Jun 12 15:52:45 2018
    Vince Coen wrote to Black Panther <=-

    Hi Vince,

    Is there a way to use the Lazarus version number set up in the Project Options -=> Version Info, as a variable in the code?

    If you use the configure;make build facilty you can create version,
    build numbering within and just change the vars in configure.in before running the build script.

    AS for the info in a program is this for pickup during running or at
    the build stage. If the later that is simple enough even if you issue a export version-var before running in a script.

    If the former you will need to check the fpc docs to see if there is a function
    for it or write your own or again use an exported vars for your program
    to pick up.

    I do use the developed program version for displays and the printed reports but
    the make script does make use of the compiler version sometimes but not often as I am more concerned with the platform.

    I was able to achieve what I was working on. Gene had posted a link to the info that I was unable to find in my searches.

    One of the programs I'm working on, will announce new files received by a BBS, by reading the .tic files, which are copied into a seperate directory before processing. As there are a few people using the program, I thought it would be easier for me, to be able to see which version they are running. It helps me to be be able to troubleshoot any issues they might be having. :)

    I figure I'm not doing too bad, since I've never had any training in Pascal. Everything I've done has been self-taught over the last year. I've been so grateful there are sites like www.freepascal.org... ;)

    Thanks,



    ---

    Black Panther
    A.K.A. - Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again...


    ... compiled, first screen came up, ship it!!!

    ___ MultiMail/Linux v0.51

    --- Mystic BBS/QWK v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (1:317/3)
  • From mark lewis@1:3634/12.73 to Dan Richter on Wed Jun 13 12:54:28 2018
    On 2018 Jun 11 19:53:20, you wrote to All:

    Is there a way to use the Lazarus version number set up in the Project Options -=> Version Info, as a variable in the code?

    do you mean for something like this??

    myProgram DEBUG version 0.7.7.3 [2015/03/29 04:00:54]
    Compiled with FPC 2.6.4 for OS2 running on i386

    i do it with the following code...

    ----->8 snip 8<-----
    procedure TMyApplication.WriteVersion;

    begin
    writeln;
    writeln(prog_name + {$IFDEF DEBUG} ' DEBUG' + {$ENDIF} ' version ' + prog_ver
    + ' [' + {$I %DATE%} + ' ' + {$I %TIME%} + ']');
    writeln('Compiled with FPC ' + {$I %FPCVERSION%} + ' for ' + {$I %FPCTARGETOS%} + ' running on ' + {$I %FPCTARGETCPU%});
    writeln('Copyright (c) 2011-2014, Quartz Crystal Software');
    writeln('All Rights Reserved');
    writeln;
    end;
    ----->8 snip 8<-----


    i am not aware of any way to put the Lazarus version in... it isn't as important as the compiler (aka FPC) version...


    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... Always obey your superiors... if you have any. - Mark Twain
    ---
    * Origin: (1:3634/12.73)
  • From Gene Buckle@1:138/142 to Dan Richter on Thu Jun 14 09:41:40 2018
    Re: Re: Lazarus and FPC
    By: Dan Richter to Gene Buckle on Tue Jun 12 2018 12:08 pm

    http://forum.lazarus.freepascal.org/index.php?topic=1243 5.0

    How did I not see that in my searching? Thank you.
    You're quite welcome!

    g.
    --- SBBSecho 2.27-Win32
    * Origin: The Retro Archive (1:138/142)
  • From Gene Buckle@1:138/142 to Dan Richter on Thu Jun 14 09:42:44 2018
    Re: Re: Lazarus and FPC
    By: Dan Richter to Vince Coen on Tue Jun 12 2018 03:52 pm

    I figure I'm not doing too bad, since I've never had any training in Pascal. Everything I've done has been self-taught over the last year. I've been so grateful there are sites like www.freepascal.org... ;)

    Post your questions here too. :)

    g.
    --- SBBSecho 2.27-Win32
    * Origin: The Retro Archive (1:138/142)
  • From Dan Richter@1:317/3 to mark lewis on Wed Jun 13 17:38:05 2018
    mark lewis wrote to Black Panther <=-

    On 2018 Jun 11 19:53:20, you wrote to All:

    Is there a way to use the Lazarus version number set up in the Project Options -=> Version Info, as a variable in the code?

    do you mean for something like this??

    myProgram DEBUG version 0.7.7.3 [2015/03/29 04:00:54]
    Compiled with FPC 2.6.4 for OS2 running on i386

    Hi Mark,

    I was actually looking for a way to use the program version number that is under 'Project Options' then 'Version Info'.

    I was able to find the information I needed thanks to Gene's reply.

    Thank you though. :)



    ---

    Black Panther
    A.K.A. - Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again...


    ... Programming _can_ be fun.
    ___ MultiMail/Linux v0.51

    --- Mystic BBS/QWK v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (1:317/3)
  • From mark lewis@1:3634/12.73 to Dan Richter on Tue Jun 19 15:30:48 2018

    On 2018 Jun 13 17:38:04, you wrote to me:

    Is there a way to use the Lazarus version number set up in the Project
    Options -=> Version Info, as a variable in the code?

    do you mean for something like this??

    myProgram DEBUG version 0.7.7.3 [2015/03/29 04:00:54]
    Compiled with FPC 2.6.4 for OS2 running on i386

    I was actually looking for a way to use the program version number
    that is under 'Project Options' then 'Version Info'.

    oh! i never mess with that... it is only included in certain specific targets... i code my apps' version numbers in them as an include file that is automatically adjusted by my compiling script(s) when necessary ;)

    I was able to find the information I needed thanks to Gene's reply.

    i might have to take a closer look and see what the deal is :)

    Thank you though. :)

    you're quite welcome ;)

    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... Gratuitous acts of senseless violence are MY forte.
    ---
    * Origin: (1:3634/12.73)
  • From Ozz Nixon@1:275/362 to mark lewis on Wed Jun 20 11:26:07 2018

    myProgram DEBUG version 0.7.7.3 [2015/03/29 04:00:54]

    prog_ver + ' [' + {$I %DATE%} + ' ' + {$I %TIME%} + ']');

    Cool find! I have been doing a pre-compiler run of timestamp.exe to generate an
    {$I timestamp.inc} in my code. I will have to add those two to my compiler Modern Pascal.

    Right now, I do $IFDEF for the OS and CPU for my projects. Stealing your idea for timestamp ;-)

    --- dBridge & Rhenium
    * Origin: RVA Fido Support - ExchangeBBS.com, ModernPascal.com (1:275/362)
  • From Ozz Nixon@1:275/362 to mark lewis on Wed Jun 20 11:26:07 2018


    myProgram DEBUG version 0.7.7.3 [2015/03/29 04:00:54]

    prog_ver + ' [' + {$I %DATE%} + ' ' + {$I %TIME%} + ']');

    Cool find! I have been doing a pre-compiler run of timestamp.exe to generate an
    {$I timestamp.inc} in my code. I will have to add those two to my compiler Modern Pascal.

    Right now, I do $IFDEF for the OS and CPU for my projects. Stealing your idea for timestamp ;-)

    --- dBridge & Rhenium
    * Origin: RVA Fido Support - ExchangeBBS.com, ModernPascal.com (1:275/362)