Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Object or class type requiered (https://www.delphipraxis.net/206566-object-class-type-requiered.html)

dadas25 7. Jan 2021 10:40

Object or class type requiered
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo alle zusammen, ich habe hier einen Fehler mit dem ich nix anfangen kann, dieser kommt auch nur in alten Delphi Version (beim Versuch die Unit zu compiieren), in neueren, also >=XE lässt es sich ohne Probleme kompilieren.

Ich habe den Fehler mit einer kleinen Test Unit erzwungen, kann mir jemand helfen, danke euch.

Delphi-Quellcode:
unit testShadow;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type

  TForm1 = class(TForm)
    Button1: TButton;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

type
  TDropShadowType =(dstNone, dstStandard);


Test = class(TObject)
  private
  fDropShadow: TDropShadowType;


  procedure SetDropShadow (const value: TDropShadowType);

  public
  constructor create();

  published
  property DropShadow: TDropShadowType read fDropShadow write SetDropShadow;


end;

implementation

{$R *.DFM}


procedure Test.SetDropShadow(const value: TDropShadowType);
begin
  fDropShadow := Value;

end;

constructor Test.create();
begin

  DropShadow := TDropShadowType.dstStandard;

end;


end.
Hier noch der Fehler als Screenshot im Anhang.

Da das Teil eines Packages/ Komponente ist, sollte es auch in alten Versionen kompilierbar sein, vielen Dank.

Klaus01 7. Jan 2021 10:47

AW: Object or class type requiered
 
.. und so?

Delphi-Quellcode:
constructor Test.create();
begin

  DropShadow := {TDropShadowType.}dstStandard;

end;

dadas25 7. Jan 2021 10:53

AW: Object or class type requiered
 
Zitat:

Zitat von Klaus01 (Beitrag 1480461)
.. und so?

Delphi-Quellcode:
constructor Test.create();
begin

  DropShadow := {TDropShadowType.}dstStandard;

end;

Thats it :-) danke, super Toll ehrlich :-)


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:33 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz