Treat typed constants as non-typed constants

Top  Previous  Next

User interface > Translation options > Tuning options > Treat typed constants as non-typed constants

 

The tuning option Treat typed constants as non-typed constants concerns typed constants like

 

const

  tc : integer = 7;

 

In Delphi 7 such typed constants were writable like variables. Delphi2Cpp II imitates this behavior when the option to treat typed constants as non-typed constants is deactivated. The constant then becomes an extern variable in C++. The definition is written into the header:

 

extern int tc;

 

and the implementation is written into the source file:

 

int tc = 7;

 

 

If option to treat typed constants as non-typed constants is activated, the constants of sinmple types are treated as a non-typed constant. (An example of a non-typed constant is: "const c = 7;".) There is only one line as output:

 

const int tc = 7;

 

 

In the more current versions of Delphi typed constants are writable only if the {$J+} directive is set.

 



This page belongs to the DelphiXE2Cpp11 Documentation

DelphiXE2Cpp11 home  Content