Is

From Free Pascal wiki
Revision as of 09:50, 30 March 2019 by Djzepi (talk | contribs) (Created page with "{{Is}} The reserved word <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> belongs to object-oriented programming. The <syntaxhighlight lan...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) suomi (fi)

The reserved word is belongs to object-oriented programming. The is operator is used to test whether the object is an instance of the specified type (class or child class). It takes an object on the left side of the is operator and a type on the right side of the operator. The result is the value of boolean indicating whether the object belongs to this type or not.

Example:

  ...
  If fruit is TCitrusFruit then ... // Check if the fruit object belongs to the class of TCitrusFruit
  ...