texttransformer.jpg

10/28/2024

Delphi2C# 2.5.0

Symbol names matching declaration case

When converting from Delphi to C++, it is essential to ensure consistent capitalization across all identifiers. Previously, this was achieved by enforcing a uniform notation for all identifiers that differed only in letter case. However, starting with version 2.5.0, there is now an option to retain the original case used in each identifier's declaration. This option is now enabled by default, and the previous approach is considered deprecated.

For example in the following unit there are defined a constant, a property and a parameter with the names "name", "Name" and "NAME".

unit casesensitivity;

interface

const
  name: string = 'DefaultName';

type
  TPerson = class
  private
    FName: string;
  public
    property Name: string read FName write FName;
    procedure DisplayInfo(NAME: string);
  end;

implementation

procedure TPerson.DisplayInfo(Name: string);
begin
  WriteLn('Parameter Name: ' + Name);
  WriteLn('Property Name: ' + Self.Name);
  WriteLn('Constant Name: ' + casesensitivity.Name);
end;

end.

By use of the deprecated "unify all cases" option all symbols were given identical names and the DisplayInfo procedure became to:

public void DisplayInfo(string name)
{
  Console.WriteLine("Parameter Name: " + name);
  Console.WriteLine("Property Name: " + this.name);
  Console.WriteLine("Constant Name: " + casesensitivity.casesensitivityInterface.name);
}

With the new option the three symbol names all are used in the procedure DisplayInfo, This is possible, because they are declared in different scopes. Delphi2Cpp converts the procedure for C++Builder to:

public void DisplayInfo(string NAME)
{
  Console.WriteLine("Parameter Name: " + NAME);
  Console.WriteLine("Property Name: " + this.Name);
  Console.WriteLine("Constant Name: " + casesensitivity.casesensitivityInterface.name);
}

The option to match the declaration names avoids problems that arise when different parts of the code are translated with different identifier lists





10/19/2023
Delphi2C# 2.3
Conversion of DFM files to C++

- Adoption of the feature of Delphi2Cpp to convert the code from DFM files. This can now optionally be converted into C# code that is executed at runtime when the form or a frame is created. Essentially, the DFM code is a series of simple assignments of values to component properties. Delphi2C# also manages to map other, sometimes complex serialization actions in an intuitive and simple way. For this purpose, special routines are called which do not assign the values directly to the properties, but rather pass them as arguments to the routines, in which further actions can then be carried out. Specifically for third-party components, Delphi2C# can be configured to call such custom functions. This conversion of DFM code is the essential bridge to using C# GUI libraries.

More details to the DFM conversion

01/31/2023
Facilitated translation of incomplete code
  • Recursive search for required units during translation
  • Optional generation of dummy code
  • Exclusion of certain files from translation
  • Use of a "cover" file for unknown types
  • The use of pointer simulation is now optional
  • A file with global usings directives can now be created
  • Unification of string and character constants (both as strings)
  • Destructors are removed
  • Identifiers can be replaced by complex expressions

04/02/2020 documentation actualized
10/16/2019 offer of Delphi2C# beta


   deutsch Deutsch

 

 
Latest News
10/28/24
Delphi2C# 2.5: Symbol names matching declaration case [more...]

01/29/24
Aurora2Cpp: Delphi 7 translator [more...]



"So, all in all we are very pleased with Delphi2C#."


Henk van der Meer
Innomeer 02/02/2023

 
This website is generated from plain text with [Minimal Website ]

Minimal Website
Minimal Website is made with TextTransformer

TextTransformer
TextTransformer is made with Borland CBuilder

  borland