If you are long-time Delphi user then you probably know what I mean when I reference the “Blue Dot Problem”. For those that do not, I will start with an example.
The blue dots displayed in the editor gutter area represent executable lines of code that you can step through with the debugger and set breakpoints on. You should be able to quickly notice the Blue Dot problem in the image below. The blue dots should start on the first begin statement and there should obviously be a dot on the last ShowMessage line. There is also a trailing blue dot on empty line number 38. This is because the entire set of blue dots in this code snippet has been shifted one line down.
Why do these Blue Dot Problems occur? There are a wide number of issues that have been blamed over the years. However, one of the major underlying causes is due to the compiler only recognizing the “Windows” line end combination of Carriage Return+Line Feed (CRLF) pairs. Other major systems like Linux, macOS only use a single LF character to end a line of text so if you are sharing source files between these systems, then those files may end up being problematic for the Delphi compiler. Sometimes a file gets corrupted and is full of proper CRLF delimited text and only a line or two has a single CR or LF line ending character. (Note that this is a very old problem that has plagued many applications and not just the Delphi editor and compiler.) As David Schwartz pointed out on Facebook, this can also happen when you copy and paste code from something that only has linefeed characters (perhaps from an internet source.)
This is one of the many issues addressed with the recent RAD Studio 10.4.2 Sydney release. There have been many reports of this Blue Dots Problem over the years with RSP-28156 being an example of the specific error above. The solution for many of these Blue Dot Problems is a new Line Endings configuration option to handle “Inconsistent line endings” with the default choice of “Convert files with known extensions to CRLF” This new setting is available in the Tools->Options menu under the User Interface->Editor section. You can currently select from the following choices:
Convert all files to CRLF
Convert file with known extensions to CRLF
The current list of Known extensions include:
With the introduction of 10.4.2, the number of times that the Blue Dots displayed in your editor are out of sync with the lines of source code should rapidly diminish! Huzzah! Kudos to Embarcadero for addressing this definitely sporadic, but infinitely annoying problem.
With nearly 1,000 issues addressed in RAD Studio 10.4.2, this is seemingly another must-have release. Sooner or later, with releases like this coming out of Embarcadero, Delphi may no longer be such a secret weapon!
Since it’s Delphi’s 26th Birthday, there’s a nice discount available if you purchase a new license or upgrade. Check out their specials page for the latest details! It’s time to upgrade to Delphi 10.4.2!