Leaderboard
Popular Content
Showing content with the highest reputation on 11/21/18 in Posts
-
Custom Managed Records Coming in Delphi 10.3
Stefan Glienke replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Better than releasing something that is broken and makes all your code fail, amiright? -
For..to..step in Delphi
Stefan Glienke replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
@Arnaud Bouchez I know you like to deal with low level stuff but being able to be more declarative about loops and other language constructs is a benefit imo. That var passing of the loop variable is bad, but Primoz wrote that just for fun and advised not to use it. I guess every Delphi developer knows how a while or repeat loop works but I have seen enough off by one errors caused by counting the loop variable wrong, messing up the loop condition or other stuff which could just be eliminated if the language itself could treat it right without the need to put extra abstractions ontop that just make code slower. Another thing that just applies to 10.3 though is that only in a for loop you can inline declare the variable to only be valid in the loop scope and not outside. -
Custom Managed Records Coming in Delphi 10.3
Leif Uneus replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Unfortunately the introduction of custom managed records has been deferred to version 10.4 See http://blog.marcocantu.com/blog/2018-november-deferring-managed records.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+marcocantublog+(marcocantu.blog) Pity, since I can see many important use cases for this language enhancement. Guess I will have to bide my time another year. -
Strange and Random Access Violations
Cristian Peța replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
It can brake reference counting only if you move() to string. When you only move() from string the string is not affected in any way. Move() doesn't change the source. -
VCL Support for Per Monitor v2 and GetSystemMetrics Coming in 10.3
Uwe Raabe replied to Marco Cantu's topic in VCL
The Owner is not necessarily the form. Sometimes the owner is a TFrame descendant or may even be nil. Iterating the Parent until a TCustomForm is found is usually the way to get the required form instance. Perhaps iterating until Parent is nil is another valid approach. That would also cover the case where one form is parented into another one. -
VCL Support for Per Monitor v2 and GetSystemMetrics Coming in 10.3
Marco Cantu posted a topic in VCL
See my latest blog post at http://blog.marcocantu.com/blog/2018-nov-vcl-permonitorv2_getsystemmetrics.html -
Yes, there is something with Synedit...... But not every time I will compile it with Madexcept enabled, maybe I will see more
-
VCL Support for Per Monitor v2 and GetSystemMetrics Coming in 10.3
Marco Cantu replied to Marco Cantu's topic in VCL
Actually I was imprecise. It doesn't use the parent handle, but walks over the parent hierarchy up to the containing form -
For..to..step in Delphi
Lars Fosdal replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
Not efficient, not tested, but fun 😄 User exercise - make a Range.AsDouble(0, 5, 0.25) type Range = record class function AsInt(const aFrom, aTo: Integer; const aStep: Integer = 1): TArray<Integer>; static; procedure Test; end; class function Range.AsInt(const aFrom, aTo, aStep: Integer): TArray<Integer>; var ix, n: Integer; v: Integer; begin n := ((aTo - aFrom) + 1) div aStep; SetLength(Result, n + 1); v := aFrom; ix := 0; while v <= aTo do begin Result[ix] := v; v := v + aStep; end; SetLength(Result, ix + 1); end; procedure Range.Test; var ix: Integer; begin for ix in Range.AsInt(0, 11, 2) do begin Writeln(ix); end; end; -
New feature: TMARSClientResourceJSON now implements REST.Client.IRESTResponseJSON
Stuart Clennett replied to Andrea Magni's topic in MARS-Curiosity REST Library
Hi all, (Apologies for late reply) Pulled latest source & all packages build now, problem solved thanks. Yes, I am using 10,1 Berlin - sorry should've mentioned that. Kindest regards -
Strange and Random Access Violations
Fritzew replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
Can you tell us why you think these is right? There is no reason for this construct. Length(s) is enough . -
For..to..step in Delphi
Arnaud Bouchez replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
Just use a while loop! This is the clear and efficient way of writing such code, without messing with the "for" variable. var i: integer; begin i := 1; while i <= 10 do begin Writeln(i); inc(i, 2); end; Readln; end. Or a repeat .. until of course: var i: integer; begin i := 1; repeat Writeln(i); inc(i, 2); until i > 10; Readln; end. -
Strange and Random Access Violations
Kryvich replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
function StringToCharArray(const S: string): TCharArray; begin PChar(Result) := PChar(S); end; -
Strange and Random Access Violations
David Heffernan replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
You write a zero byte beyond the end of the char array. Solve the problem by using Move to perform the copy. -
For..to..step in Delphi
FredS replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
From Marco: Stepping through Values in a Delphi for Loop There has been a recent request to add to for loop in the Object Pascal language the ability to add a step, that is an increment different from one. Here is an alternative implementation using a for..in loop and a custom enumerator. -
Strange and Random Access Violations
Attila Kovacs replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
it's in the help Note: Dest should point to a location with room for MaxLen + 1 characters, including the null terminator. too bad that the compiler can't detect the out of range -
I have determined that this problem is being caused by DisplayFusion, a wonderful program to handle multiple monitors and multiple task bars. If I disable DisplayFusion from adding title bar icons to any application, (these are buttons that allow one to easily move a window to another monitor), the problem goes away. I have contacted them for support. I have been using this program for many years and really value the various screen management tools it provides, especially title bar buttons and a task bar on each monitor that shows only the apps that are running on that monitor. I'd hate to not have the DisplayFusion tools available (and frankly would probably to use it even with the nuisance of non-modal windows burning through in the debugger), so I'm really hoping they will come up with a fix. Thanks to everyone here for their support and suggestions.