How to start |
Top Previous Next |
You will get good C# translations of your Delphi code only, if you make the correct settings in dialog for the translation options, which can be shown by the button .
1. Paths to your code
Delphi2C# has to know the types and signatures of procedures and functions in your Delphi source code to make a correct translation. That's no problem as far as these information stems from your own source code. You simply have to set the paths to your source code at the in the options dialog.
2. Paths to the Delphi RTL/VCL
The paths to the files of the used Delphi RTL/VCL also have to be set into a Delphi2C# project. If you are using Delphi2C# for the first time and you are curious to get some first results, you may select the paths to the original Delphi RTL/VCL as search path for the files not to convert. But unfortunately the original Delphi source code.has bugs and in longer term it is recommended, that you prepare a copy of Embarcadero's code.
3. Extended System.pas
You should use also an "extended System.pas". This file corrects and completes the original "System.pas".
4. Setting the correct definitions
If you have selected the search paths to the Delphi RTL/VCL, your code still will not be translated correctly, if you haven't set the necessary definitions. As default MSWINDOWS is.defined. If that would not be the case, even the original Sysutils.pas could be parsed, because e.g. the following code, would not be valid:
function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle = {$IFDEF LINUX} tlbsLF {$ENDIF} {$IFDEF MSWINDOWS} tlbsCRLF {$ENDIF}): string;
5. Creating a dummy application or make a complete translation
Normally a complete translation will be made. But if your code is incomplete, you might chose to create a dummy application at first.
6. Starting the translation
After you have set your translation options you can save them by the button and open the first file to to translate with the button .. The source file is shown in the left window of the user interface. You can start the translation with the button . As soon as it is finished the C# source code is shown in the windows on the right side of the application. Also the content on the left side might have changed: now the preprocessed Delphi code is shown there. You can save the translated code by the button .
|
This page belongs to the Delphi2C# Documentation |
Delphi2C# home Content |