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) <
Jonas,
thanks but I'm still a little stuck.I only do this kind of thing once every 5
years or so..
sudo make FPC=/usr/local/lib/fpc/3.0.4/ppcx64 OPT="-ap -FD${IOS_BASE_BIN}
-XR${IOS_BASE}" CPU_TARGET=x86_64 OS_TARGET=iphonesim
CROSSOPT="-FD${IOS_BASE_BIN} -XR${IOS_BASE}" all
it seems that crt
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
I just add a small program to illustrate the type cast between signed
and unsigned:
var
si: ShortInt;
begin
si:= -127;
WriteLn( 'si ', si);
WriteLn( 'Byte(si) ', Byte(si));
si:= -1;
WriteLn( 'si ', si);
WriteLn( 'Byte(si) ', Byte(si));
end.
gives
$ ./project1
s
On Wed, Jun 16, 2021 at 2:26 PM Jean SUZINEAU via fpc-pascal
wrote:
> I think there is a way to do this with a single program.
Using Lazarus IDE I tried to set Execution level to
"requireAdministrator", but then the program simply would not run (it
would not ask for the admin password), so in th
Le 16/06/2021 à 00:31, James Richters via fpc-pascal a écrit :
In order to change the value I want to change, I need to run my program as
administrator, is there a way to change to administrator with a request from
within the program?
I guess I could make just a small program that changes the
On Wed, Jun 16, 2021 at 2:21 PM Jean SUZINEAU via fpc-pascal
wrote:
> I guess that what was meaning Bart by hardcat is that you need to
> transtype the result this way:
> var dw: DWord;
> begin
> dw:= DWord( Registry.ReadInteger(...)) ;
Indeed.
This is a lossless operation.
--
Bart
_
Le 16/06/2021 à 00:31, James Richters via fpc-pascal a écrit :
Thanks for the help, it's working fine using readinteger I guess as long as I
don't have any values large enough to need the most significant digit that
would work...
I guess that what was meaning Bart by hardcat is that you need
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, Jun 16, 2021 at 9:08 AM James Richters via fpc-pascal
wrote:
>
> >You can have a look too at TRegDataType type, it seems there is nothing
> >special for DWord.
>
>
>
> I got the list of functions you mentioned in Lazarus.. Here are all the ones
> that can read:
As I said before, it is
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
_
>You can have a look too at TRegDataType type, it seems there is nothing
special for DWord.
I got the list of functions you mentioned in Lazarus.. Here are all the ones
that can read:
function ReadCurrency(const Name: UnicodeString): Currency;
function ReadCurrency(const Name: String): Cu
26 matches
Mail list logo