Cita:
Empezado por barman
¿Cual era la pregunta?
|
Cita:
Empezado por barman
no tengo ni idea de los que hace el is de delphy
|
mejor dejo que el propio delph
i se explique:
Cita:
Empezado por delphi help
The is operator, which performs dynamic type checking, is used to verify the actual runtime class of an object. The expression
object is class
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 other—a 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.
|
De esta cuenta, que las siguientes operaciones resultarian en:
siendo miGrid un TDBGrid:
Código:
miGrid is TDBGrid (true) miGrid si es un TdbGrid
miGrid is TCustomControl (true) miGrid si es un TdbGrid
miGrid is TComponent (true) miGrid si es un TdbGrid
miGrid is TObject (true) miGrid si es un TdbGrid
miGrid is TStringGrid (falso) miGrid no es un TStringGrid
Hasta luego.