Difference between revisions of "Is"
From Lazarus wiki
Jump to navigationJump to search (Created page with "{{Is}} The reserved word <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> belongs to object-oriented programming. The <syntaxhighlight lan...") |
|||
Line 1: | Line 1: | ||
{{Is}} | {{Is}} | ||
− | The [[Reserved word|reserved word]] <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> belongs to object-oriented programming. | + | The [[Reserved word|reserved word]] <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> belongs to [[object-oriented programming]]. |
The <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> operator is used to test whether the object is an instance of the specified [[Type|type]] ([[Class|class]] or child class). It takes an object on the left side of the <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> operator and | The <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> operator is used to test whether the object is an instance of the specified [[Type|type]] ([[Class|class]] or child class). It takes an object on the left side of the <syntaxhighlight lang="pascal" enclose="none">is</syntaxhighlight> operator and | ||
a type on the right side of the operator. The result is the value of [[Boolean|boolean]] indicating whether the object belongs to this type or not. | a type on the right side of the operator. The result is the value of [[Boolean|boolean]] indicating whether the object belongs to this type or not. |
Revision as of 15:18, 3 April 2019
│
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
...