The New[] Statement is Allowed Only for Simple Types

Description

Square brackets combined with simple types and the New keyword are used to initialize arrays. Any other combination of square brackets and the New statement is not allowed.

Troubleshooting Tips

Use only simple types when initializing an array.

Example

Sub UserProc;
Var
    s: Array;
Begin
    s := New Array[3];
End Sub UserProc;

When the specified code is compiled, the string s := New Array[3]; displays the following error: The New[] statement is allowed only for simple types. To resolve the error, change the type that is used to initialize an array as follows: s := New Variant[3];.

See also:

Compiler Messages