Extended "System.pas" |
Top Previous Next |
User interface > Translation options > Input options > Extended "System.pas"
"System.pas" is a source file of special importance in Delphi projects.Fundamental type definitions, procedures and functions are defined in the System unit, which is implicitly included in every unit. For example TObject is defined there. There are other intrinsic definitions like the Read, Write or Str function, which are accessible in each unit too. These intrinsic function are built into the Delphi compiler. Delphi2Cpp II must know the signatures of such intrinsic functions and tries to find them in the System.pas. So the original incomplete System.pas either has to be replaced by an extended copy or a the original System.pas has to be supplemented by an additional source file.
In the options dialog you can set the name of such an additional System.pas extension file.
Such an individual System.pas called d2c_system.pas is in the Source folder of the Delphi2Cpp II installation. No matter which name the file has, it internally is renamed to "d2c_system". With this name it is shown in the log-tree.
If an individual System.pas is used, the specially treated RTL/VCL functions and some compile time functions (Abs, High, Low, Odd, Pred, Succ) might have to be defined in this file for types, that cannot be handled by the built-in translation alternatives. Such a case is the incrementation of values of enumerated types. Of course, these definitions are only needed, if such cases really appear in the source code.
Some examples are explained in the following topics:
The overwritten System.pas gets always preprocessed, even if the option to pre-process files is disabled for all other files. Because this file is very basic, it may not use other files.
Lookup algorithm
Delphi2Cpp II looks up system types and functions etc. in following order::
Mostly Delphi2Cpp II cannot distinguish different elements with the same name. Delphi2Cpp II takes just the first declaration it finds. If there are several functions with the same name the translator tries to match the declaration found first.
|
This page belongs to the DelphiXE2Cpp11 Documentation |
DelphiXE2Cpp11 home Content |