RAD Studio (Common)
ContentsIndex
PreviousUpNext
E2007: Constant or type identifier expected (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.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!