Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Travis Siegel via fpc-pascal
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,

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Jean SUZINEAU via fpc-pascal
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)

Re: [fpc-pascal] Trying to update to: Xcode 12.5, FPC 3.2.2

2021-06-16 Thread conlin664 via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Bart via fpc-pascal
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,

Re: [fpc-pascal] TRegistry documentation

2021-06-16 Thread Jean SUZINEAU via fpc-pascal
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

Re: [fpc-pascal] TRegistry documentation

2021-06-16 Thread Bart via fpc-pascal
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

Re: [fpc-pascal] TRegistry documentation

2021-06-16 Thread Jean SUZINEAU via fpc-pascal
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

Re: [fpc-pascal] TRegistry documentation

2021-06-16 Thread Bart via fpc-pascal
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

Re: [fpc-pascal] TRegistry documentation

2021-06-16 Thread Jean SUZINEAU via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Sven Barth via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Bo Berglund via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread LacaK 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 instantiated in the startupcode. There are also global variables,

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Marco van de Voort via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Michael Van Canneyt via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread LacaK 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. If you want smallest executable size you must get rid of SysUtils also. And you must call platform dependent OS API ... L.

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Mattias Gaertner via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Bo Berglund via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Michael Van Canneyt via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Tomas Hajny via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Marco van de Voort via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Tomas Hajny via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Marco van de Voort via fpc-pascal
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?

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Tomas Hajny via fpc-pascal
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

Re: [fpc-pascal] TRegistry documentation

2021-06-16 Thread Bart via fpc-pascal
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

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread 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, if they have e.g. initialization sections. Mattias

Re: [fpc-pascal] TRegistry documentation

2021-06-16 Thread James Richters via fpc-pascal
>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):

[fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Bo Berglund via fpc-pascal
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