function IsObject(const v): Boolean;
begin
Result := False;
try
TObject(v).ClassName;
Result := True;
except
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
i := 1;
if not IsObject(i) then ShowMessage('i is not object');
if IsObject(Self) then ShowMessage('self is object');
end;