-
Content Count
523 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Vandrovnik
-
Record Circular References
Vandrovnik replied to Bernard's topic in Algorithms, Data Structures and Class Design
I believe Anders is right. Class reference is just a pointer - its size is known. When you use this class as a member of another class (fChild: tChild, where tChild is a class), you cannot reference its members in properties (property x: integer read fChild.x). If fChild is a record (fChild: tChild, where tChild is a record), you can reference its members in properties, like in Anders' example (property x: integer read fChild.x). -
Record Circular References
Vandrovnik replied to Bernard's topic in Algorithms, Data Structures and Class Design
If size was the only problem, I can imagine something like this ("human preprocessor"): type tRecordA = record of size 8; tRecordB = record ... function Test: tRecordA; end; tRecordA = record x, y: integer; end; -
Record Circular References
Vandrovnik replied to Bernard's topic in Algorithms, Data Structures and Class Design
Something like a record helper 🙂 I always wonder why there can be just one class/record helper... -
Delphi Rio IDE hangs again and again
Vandrovnik replied to microtronx's topic in Delphi IDE and APIs
Or NativeInt(pointer(... or NativeUInt(pointer(... Just when I see this typecasting pointer to integer, I can't help thinking that 64 bit IDE is far away 🙂 -
Delphi Rio IDE hangs again and again
Vandrovnik replied to microtronx's topic in Delphi IDE and APIs
64 bit IDE would probably require all design time packages to be 64 bit, too... I was surprised to see typecast "integer(pointer(..." in https://blog.marcocantu.com/blog/2020-may-custom-managed-records.html ... -
Function with just underscore _() seems to be valid
Vandrovnik replied to Mike Torrettinni's topic in General Help
With this info in mind, for bad customers you can start programming like that: const _ = 1; _____ = 2; x = _____ + (_-_-_) + 0 + _+0-0+_ ; -
May be https://github.com/neslib/FastMath and/or http://docwiki.embarcadero.com/RADStudio/Rio/en/Floating_point_precision_control_(Delphi_for_x64) can help.
-
Does this data structure exist? TDataStructure<TKey, TKey, TValue, TPayLoad> ?
Vandrovnik replied to PolywickStudio's topic in Algorithms, Data Structures and Class Design
tDictionary alone will not allow you to store more values for the same key (it seems you need it: "I get all values of (TKey1 = 1) for the data. "). You could use two dictionaries: tDictionary<tKey1, tObjectList> tDictionary<tKey2, tObjectList> In these object lists, there will be all objects with corresponding values of the tKey1, resp. tKey2. -
It happens to me +- once every two weeks, too.
-
You mean something like this? type tSledovaniVykonuSeznamVysledku=class(tObjectList<tSledovaniVykonuVysledky>) ... var Cmp: IComparer<tSledovaniVykonuVysledky>; begin Cmp:=tDelegatedComparer<tSledovaniVykonuVysledky>.Create( function(const Left, Right: tSledovaniVykonuVysledky): Integer begin result:=CompareStr(Left.Nazev, Right.Nazev); end); Sort(Cmp);
-
Thank you, AsmProfiler suites the best.
-
Google Chrome is blocking the download of my application — HELP!!!
Vandrovnik replied to Steve Maughan's topic in General Help
I have just tried to download it using Chrome (Czech version 81.0.4044.122 (Oficiálnà sestavenÃ) (64bitový) ), downloaded without problems, browser allowed me to start the downloaded .exe. -
What about remote debugging?
-
Variant to generic T, how?
Vandrovnik replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
This compiles, but I have not tested, whether it works as expected 🙂 ToField<T> = class(tObject) private fData : T; protected procedure SetFromVariant(const aValue : Variant); end; procedure ToField<T>.SetFromVariant(const aValue: Variant); var val: TValue; begin val := TValue.FromVariant(aValue); fData := val.AsType<T>; end; -
How do you deal with deprecated symbols in backwards compatible code?
Vandrovnik replied to dummzeuch's topic in RTL and Delphi Object Pascal
Do you have an idea, how many users really need new functions for old versions of Delphi? If there are not many of them, I would suggest to drop support for old versions - you can probably spend your time better than keeping code compatible with old Delphi... -
Structure Panel empty - how to get Embarcadero support?
Vandrovnik replied to PeterPanettone's topic in Delphi IDE and APIs
Probably the same problem as in Project Window https://quality.embarcadero.com/browse/RSP-27182 It is reported, but when it will be fixed... -
What about DirectWrite? It should support OpenType fonts.
-
Does AV happen on one computer, or all? Every query, or just some (with parameters? with string result? with only integer result? etc.)?
-
But he wrote that error happens in external .dll when he opens a query, not in his code.
-
Build and install all designtime packages - Feature request
Vandrovnik replied to Tommi Prami's topic in Delphi IDE and APIs
Installing components after each IDE update is a pain for me, so I created a .bat script, which recompiles all components (Win32 runtime, Win64 runtime, Win32 design time). It writes a list of created .bpl files to a text file. The only manual part then is to add them to the IDE: Component, Install packages, Add, paste the path to the .bpls. I still did not try to add all bpls in one step, may be it works :-), but I enter them one by one. -
Delphi 10.3.3 Problems with x64-Debugger
Vandrovnik replied to johnnydp's topic in Delphi IDE and APIs
I have not seen this problem, but I also almost do not debug Win 64 apps, because it is much slower on my PC. So I debug 32 bit versions and just occasionally test 64 bit versions. -
Smaller custom component between design & Running mode
Vandrovnik replied to Damien Leveugle's topic in VCL
I guess in the IDE, you draw for example 12 px box, but whole IDE is scaled by Windows, so that it is displayed as 24 px (example). In running application, if your application is HDPI enabled, than Windows does not do the scaling. So original checkbox is drawn 24 px, because it is able to do it by itself, but your component is drawn 12 px, because it does not calculate proper size. -
Delphi Rio IDE hangs again and again
Vandrovnik replied to microtronx's topic in Delphi IDE and APIs
Can you compile to one big .exe for debugging and to packages only for release? -
I think till now they store database password in plain text in a config file and now they want something better, so that their users cannot read password from it. If they store password xored with a secret key, it would help against "normal" users. If they do not want to store that secret key in .exe, they can generate it on the fly - for example, using a random number generator set to a specific seed and obtaining generated values. It will not be hacker-proof, but it will be curious-user-proof, which is probably good enough for a legacy application.