The New Statement is not Allowed for Simple Types

Description

The identifier of a simple data type or an enumeration type identifier is specified after the New keyword when a variable is initialized.

Troubleshooting Tips

Variables with a simple type of data are initialized automatically when declaring the variables. All enumeration types are inherited from the Integer simple data type. Delete the New statement.

Example

Sub UserProc;
Var
    i: Integer;
Begin
    i := New Integer.Create;
End Sub UserProc;

When the specified code is compiled, the string i := New Integer.Create; displays the following error: The New statement is not allowed for simple types. To resolve the error, delete the New statement and use other methods allowed for the Integer variables or assign an integer value to the variable.

See also:

Compiler Messages