Reference & Resources »

Which names to avoid?

Delphi's reserved words cannot be redefined or used as identifiers, such as: begin, function, if, procedure,...
See: Forbidden words: Delphi's reserved words

But also other words can lead to very difficult to debug errors, such as:

  • names of objects: Application Screen,...
  • object properties: Color, Height
  • object methods: Hide, Show,...
  • objects events: OnActivate, Onclick,...
  • names of built-in modules: Windows, Messages, Classes,...
  • built-in global constants: clWhite, clRed,...

We strongly advise you to avoid them as identifiers in your source code.
Below you find a non-exhaustive list of Delphi's "dangerous" words that you should avoid as identifiers in your Delphi or Lazarus programs. Also avoid names of "classes" that are commonly used in Delphi, such as: TActionList, TCheckBox, TComponent, TControl, TGroupBox, TImage, TMemo, TPanel, TObject, TPopupMenu, TRadioButton, TRadioGroup, TScrollBar and so on.

AvoidAlready
used as...
Actionproperty
Alignproperty
Applicationobject
AutoSelectproperty
 
BevelWidth
 
property
BorderWidthproperty
 
Caption
 
property
clRedconstant
clWhiteconstant
Colorproperty
Cursorproperty
 
Enabled
 
property
 
Font
 
property
 
Height
 
property
Hidemethod
Hintproperty
       
AvoidAlready
used as...
Iconproperty
ItemIndexproperty
 
Left
 
property
 
Menu
 
property
 
Name
 
property
 
OnActivate
 
event
OnClickevent
OnCloseevent
OnCreateevent
OnDeactivateevent
OnDestroyevent
OnHideevent
OnDestroyevent
OnKeyDownevent
OnKeyPressevent
OnKeyUpevent
OnMouseDownevent
OnMouseDownevent
OnShowevent
       
AvoidAlready
used as...
ParentColorproperty
 
ReadOnly
 
property
Screenobject
Selfobject
Showmethod
ShowHintmethod
 
Tag
 
property
TButtonclass
TEditclass
Textproperty
TFormclass
TLabelclass
Topproperty
 
Visible
 
property
Widthproperty
 
FAQ  Crash Course Delphi  Tips  Source Code  Downloads  Links

© Copyright 1999-2022 
DelphiLand