> Am 16.06.2021 um 18:07 schrieb Dennis Lee Bieber via fpc-pascal
> :
>
> On Wed, 16 Jun 2021 13:15:10 +0200 (CEST), Michael Van Canneyt via
> fpc-pascal
> declaimed the following:
>
>> ~$ ldd /usr/bin/ls
>> linux-vdso.so.1 (0x7ffc3f9c1000)
>> libselinux.so.1 => /lib/x86_64-linu
On 6/19/21 9:40 AM, Bo Berglund via fpc-pascal wrote:
Strange name of a function, though, is that needed?
idk why the specific name was selected but you need some easy way to add leading
zeros if you want them... some might complain about the conversion from integer
to string, though... i've
Le 19/06/2021 à 15:40, Bo Berglund via fpc-pascal a écrit :
function _2d( _i: Integer): String;
Strange name of a function, though, is that needed?
No, it's not needed, it's just my odd way of naming ... ;-) (the closer
to %.2d ).
___
fpc-pascal mai
On Fri, 18 Jun 2021 18:13:52 +0200, Jean SUZINEAU via fpc-pascal
wrote:
>
>function _2d( _i: Integer): String;
>begin
> Str( _i, _2d);
> if Length(_2d) < 2 then _2d:= '0'+_2d;
>
>end;
Thanks,
it seems like this gets rid of the Format call, which probably brings in a lot
of un-needed st
Ooops... little overflow bug
My computer has reached 33 days of uptime today and with
var
t, d, h, m, s: Integer;
you switch to the negative side ...
I got a display like : -8:-4:-52
Replacing with QWord solved the problem (I imagine DWord would just
allow for something like 66 days)
var
Heh, how very cool. I wasn't aware powershell could do such things.
All kinds of new things learned in this thread. Thanks for that.
On 6/17/2021 5:08 AM, Jean SUZINEAU via fpc-pascal wrote:
10 kb of Powerbasic ... you're cheating, it's pascal here ;-)
You can do this with just 1kb of Power
Op 2021-06-16 om 23:49 schreef Jean SUZINEAU via fpc-pascal:
My best score is 67 kb after strip -s with the code below ... ;-)
The fact that you use "result" for function result indicates that you
use a object pascal mode, and not the default. If you don't do that
(compile in the default mo
On 2021-06-16 23:49, Jean SUZINEAU via fpc-pascal wrote:
My best score is 67 kb after strip -s with the code below ... ;-)
Of course it will not work on every version of Windows.
program uptime;
function GetTickCount64: QWord; stdcall; external 'kernel32.dll';
function _2d( _i: Integer): Str
10 kb of Powerbasic ... you're cheating, it's pascal here ;-)
You can do this with just 1kb of PowerShell ...
( may be Pascal script could even be shorter ...)
File uptime.ps1 :
$MethodDefinition = @"
[DllImport("kernel32")] public extern static UInt64 GetTickCount64();
"@
$Kernel32 = Add-Type
Thanks for the sample. For what it's worth, I got the executable down
to just 10K using powerbasic version 6, I suspect that's as small as it
can get, since I did have to include a winbase.inc that comes with the
compiler to get the function call of the GetTickCount64 call. But then
again, I
My best score is 67 kb after strip -s with the code below ... ;-)
Of course it will not work on every version of Windows.
program uptime;
function GetTickCount64: QWord; stdcall; external 'kernel32.dll';
function _2d( _i: Integer): String;
begin
Str( _i, Result);
if Length(Result) <
On Wed, Jun 16, 2021 at 5:14 PM Bo Berglund via fpc-pascal
wrote:
> My use case here is that I created a Windows version of Linux "uptime" by
> starting in Lazarus with a new Project and selecting Program.
Choose Simple Program from that dialog.
No uses clause at all, so everything you need, you
Bo Berglund via fpc-pascal schrieb am
Mi., 16. Juni 2021, 13:32:
> On Wed, 16 Jun 2021 12:30:55 +0200, Mattias Gaertner via fpc-pascal
> wrote:
>
> >> Since the final binary size after using strip -s on the exe file is
> >> 271 kb it seems a bit big!
> >> Or is there a lot behind the scenes I ha
On Wed, 16 Jun 2021 12:30:55 +0200, Mattias Gaertner via fpc-pascal
wrote:
>> Since the final binary size after using strip -s on the exe file is
>> 271 kb it seems a bit big!
>> Or is there a lot behind the scenes I have missed?
>
>Classes is a hog.
>
I commented it away ane recompiled.
Worked f
Since the final binary size after using strip -s on the exe file is
271 kb it seems a bit big!
Or is there a lot behind the scenes I have missed?
Classes is a hog.
I had a look, and only tthreadlist (and with that tlist) were
instantiated in the startupcode.
There are also global variables,
Op 2021-06-16 om 12:30 schreef Mattias Gaertner via fpc-pascal:
Since the final binary size after using strip -s on the exe file is
271 kb it seems a bit big!
Or is there a lot behind the scenes I have missed?
Classes is a hog.
I had a look, and only tthreadlist (and with that tlist) were
in
On Wed, 16 Jun 2021, Bo Berglund via fpc-pascal wrote:
I had to add SysUtils to make it work but Lazarus put Classes in there by
itself.
Since the final binary size after using strip -s on the exe file is 271 kb it
seems a bit big!
Or is there a lot behind the scenes I have missed?
I see many
Since the final binary size after using strip -s on the exe file is
271 kb it seems a bit big!
Or is there a lot behind the scenes I have missed?
Classes is a hog.
If you want smallest executable size you must get rid of SysUtils also.
And you must call platform dependent OS API ...
L.
___
On Wed, 16 Jun 2021 12:26:54 +0200
Bo Berglund via fpc-pascal wrote:
> On Wed, 16 Jun 2021 12:08:26 +0200 (CEST), Michael Van Canneyt via
> fpc-pascal wrote:
>
> >FPC/lazarus tell you which units are unused, and in the Lazarus IDE
> >you can use the quick actions of the message dialog to quickl
On Wed, 16 Jun 2021 12:08:26 +0200 (CEST), Michael Van Canneyt via fpc-pascal
wrote:
>FPC/lazarus tell you which units are unused, and in the Lazarus IDE you can
>use the
>quick actions of the message dialog to quickly remove all unused units.
>I use it all the time.
Thanks, I will have a look
On Wed, 16 Jun 2021, Tomas Hajny via fpc-pascal wrote:
On 2021-06-16 11:38, Marco van de Voort via fpc-pascal wrote:
Op 2021-06-16 om 11:21 schreef Tomas Hajny via fpc-pascal:
Or if they contain $R inclusions.
...or many other things which may not be smartlinked, either because
it is not
On 2021-06-16 11:38, Marco van de Voort via fpc-pascal wrote:
Op 2021-06-16 om 11:21 schreef Tomas Hajny via fpc-pascal:
Or if they contain $R inclusions.
...or many other things which may not be smartlinked, either because
it is not possible, or because the compiler and/or linker cannot do i
Op 2021-06-16 om 11:21 schreef Tomas Hajny via fpc-pascal:
Or if they contain $R inclusions.
...or many other things which may not be smartlinked, either because
it is not possible, or because the compiler and/or linker cannot do it
right now.
Yes. But it is good to keep the things that fu
On 2021-06-16 10:58, Marco van de Voort via fpc-pascal wrote:
Op 2021-06-16 om 09:16 schreef Mattias Gaertner via fpc-pascal:
On Wed, 16 Jun 2021 08:57:13 +0200
Bo Berglund via fpc-pascal wrote:
If I by habit add a bunch of often used units to the uses clause will
that affects the size of the
Op 2021-06-16 om 09:16 schreef Mattias Gaertner via fpc-pascal:
On Wed, 16 Jun 2021 08:57:13 +0200
Bo Berglund via fpc-pascal wrote:
If I by habit add a bunch of often used units to the uses clause will
that affects the size of the compiled application even if they are
not in fact used?
Yes,
On 2021-06-16 09:16, Mattias Gaertner via fpc-pascal wrote:
On Wed, 16 Jun 2021 08:57:13 +0200
Bo Berglund via fpc-pascal wrote:
If I by habit add a bunch of often used units to the uses clause will
that affects the size of the compiled application even if they are
not in fact used?
Yes, if
On Wed, 16 Jun 2021 08:57:13 +0200
Bo Berglund via fpc-pascal wrote:
> If I by habit add a bunch of often used units to the uses clause will
> that affects the size of the compiled application even if they are
> not in fact used?
Yes, if they have e.g. initialization sections.
Mattias
_
If I by habit add a bunch of often used units to the uses clause will that
affects the size of the compiled application even if they are not in fact used?
I.e. if there are unused units in uses can I shrink the application size by
removing them?
If so is this the same for GUI and non-GUI applicat
28 matches
Mail list logo