Find all compilation errors in a Delphi project

I am reorganizing my Delphi project. I want to be able to make changes, and then see all the places in the project that break due to these changes. Just like Eclipse lists all the compilation errors for a project (in Java).

In Delphi, I can make changes and then recompile my project, but the compiler stops when it finds the first block that does not compile. I have to fix this block, compile again, which will then show me the following error, etc. Etc.

I want to see all the compilation errors in the project right away. Then I can decide whether to do it or not. For example, if the change requires manual fixing of 50 separate source files, this is not worth doing. But if it only splits 2 files, then it is easy to do.

Is there a way to do this in Delphi? Can I tell the compiler to continue working even after finding a unit that does not compile?

I am using Delphi 2010

+6
delphi
source share
4 answers

Delphi elements, as a modularity function, are conceptually on par with Java banks or .NET assemblies; they are compiled into separate files. Neither Java nor .NET can compile dependent modules when compiling errors in a referenced module.

The reason they are more complex than .NET assemblies, etc., owes their history. They were developed in part around x86 segmented architecture; Data associated with any one device cannot be larger than 64 KB. Similarly, units served as a natural division between the near code and the far code. If you are familiar with 16-bit x86, you will realize that pointers to distant data required a value for the segment, as well as an offset, whereas close to the data only needed an offset. The call next to the code was also faster than the call to the distant code. Then the programs were also less and less complicated; the block was a reasonable module granularity for a holistic subsystem. Today it is much less.

+5
source share

It is not possible to do this using the Delphi compiler, but if you plan to make changes to part of the open public interface, you can use the refactoring tools that come with the IDE to find all the links to all that you are going to change before changing it, which will give you The information you are looking for.

+5
source share

The Delphi compiler is already trying to compile as much as it can.
Unfortunately, very often the error is critical enough to prevent the compiler from switching from the error, since it cannot make an assumption about what code should be if it were compiled.

In addition, very often the errors that the compiler can give after the first error were unreliable and may even disappear after eliminating the 1st error. (witnessed by all the red squiggly lines appearing and disappearing as you type)

However, the compiler should provide all the hints and warnings (which are called bugs for some other compilers).

0
source share

You can use Ctrl-Shift-Enter to see that all events of a variable, property, method or wahtever are under the cursor. With this information you can decide your changes or not.

Alas, with the current version, this function does not work as reliably as it should.

0
source share

All Articles