The is Operator

The is operator, which performs dynamic type checking, is used to verify the actual runtime class of an object. The expression objectisclass returns True if object is an instance of the class denoted by class or one of its descendants, and False otherwise. (If object is nil, the result is False.) If the declared type of object is unrelated to class - that is, if the types are distinct and one is not an ancestor of the othera compilation error results. For example, if ActiveControl is TEdit then TEdit(ActiveControl).SelectAll;

This statement casts a variable to TEdit after first verifying that the object it references is an instance of TEdit or one of its descendants.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment