E2007 Constant or type identifier expected (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Error and Warning Messages (Delphi)

This error message occurs when the compiler expects a type, but finds a symbol that is neither a constant (a constant could start a subrange type), nor a type identifier.


program Produce;
var
  c : ExceptionClass; (*ExceptionClass is a variable in System*)
begin
end.

Here, ExceptionClass is a variable, not a type.


program Solve;
program Produce;
var
  c : Exception; (*Exception is a type in SysUtils*)
begin
end.

You need to make sure you specify a type. Maybe the identifier is misspelled, or it is hidden by some other identifier, for example from another unit.