You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- unit uutlAlgorithm;
-
- {$mode objfpc}{$H+}
-
- interface
-
- uses
- Classes, SysUtils;
-
- function Supports(const aInstance: TObject; const aClass: TClass; out aObj): Boolean; overload;
-
- implementation
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function Supports(const aInstance: TObject; const aClass: TClass; out aObj): Boolean;
- begin
- result := Assigned(aInstance) and aInstance.InheritsFrom(aClass);
- if result then
- TObject(aObj) := aInstance
- else
- TObject(aObj) := nil;
- end;
-
- end.
|