Project Options (Compatibility)

From The Oxygene Language Wiki

Jump to:navigation, search

This is an IDE topic
Feel free to add your notes to this topic below.



ProjectOptions pg2Aero.png


Compatibility Option
Description
Default Value
Allow Globals When set to true, this option allows Delphi-like global definitions like:

var SomeGlobalVariable: String;

method SomeMethod(aValue: String);
begin
  SomeGlobalVariable := aValue;
end;
False
Allow Legacy with When set to true, this allows code blocks such as:

with Class1 do begin
  Method1;
  Method2:
  Method3:
end;

where there is no explicit variable declared.

The code does not tell you anything about where the methods belong and there is the perpetual problem of future name collisions. If, for example, Method3 belonged to another class in scope, the code is much clearer using Delphi Prism's normal syntax:

with c := Class1 do begin
  c.Method1;
  c.Method2:
  Method3:
end;
False
Allow "Create" Constructor Calls See new and Constructors for more details. False
Allow Implicit var/out In Method Calls Normally, when calling a method that has 'var' and/or 'out' parameters, these keywords need to be specified, but setting this option to true allows the caller to omit 'var' and 'out'. False
Allow Unsafe Code Set this to true, if you need to use pointers. See Unsafe Code for more information. False
Allow Delphi Compatibility Syntax This option sets the default for the $DELPHICOMPATIBILITY flag. When set, it makes code more compatible with Delphi/Win32. False
Use Delphi compatible Division Operators When set, it changes the behavior of the / and div operators. By default, the / and div operators result type depends on the input types, if one of them is a float, the result is a float, else it is an integer. When this option is set, / always returns a float (double) and div returns an integer and fails on floats. False


See Also


Oxygene-48.png

Area: Oxygene IDE

IDE GlossaryKeywordsTypesFAQHow To

Navigation
Areas
More
Toolbox