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 s

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 th

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 need

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] 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): Cu

Re: [fpc-pascal] TRegistry documentation

2021-06-15 Thread James Richters via fpc-pascal
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... 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 administ

Re: [fpc-pascal] TRegistry documentation

2021-06-15 Thread Bart via fpc-pascal
On Tue, Jun 15, 2021 at 2:44 PM Jean SUZINEAU via fpc-pascal wrote: > I'm not sure which one will best match the DWord type. You'll have to use the Integer / Int64 variant and hardcats it to DWord/QWord. IIRC this is Delphi compatible. Of course it is peanuts to implement Read/WriteD/QWord() yo

Re: [fpc-pascal] TRegistry documentation

2021-06-15 Thread James Richters via fpc-pascal
I'm not using Lazarus. I guess I can try to make a sample program with it just to see what the options are. It seems like there should be a ReadDword, and ReadQword because there are an awful lot of Dword and Qword types in the registry. James ___ f

Re: [fpc-pascal] TRegistry documentation

2021-06-15 Thread Jean SUZINEAU via fpc-pascal
In Lazarus , in your source code, you can can "Ctrl + Click" on Registry.ReadString and it will bring you to the declaration of TRegistry.ReadString in unit Registry. There you will find there are other methods like ReadInteger, ReadInt64, ReadBinaryData. I'm not sure which one will best match

[fpc-pascal] TRegistry documentation

2021-06-15 Thread James Richters via fpc-pascal
Is there documentation for TRegistry somewhere? I've been searching for information on it, and so far I've only been able to find: https://wiki.freepascal.org/fcl-registry and http://docwiki.appmethod.com/appmethod/1.17/codeexamples/en/TRegistry_(Objec t_Pascal) They kind of get me started but