Einzelnen Beitrag anzeigen

mr_emre_d
(Gast)

n/a Beiträge
 
#12

Re: Was ist ein Objekt ?

  Alt 28. Jul 2008, 16:22
Appol.:
Das mit Create geht nicht !

Hier ein Codebsp:
Code:
  TBlubObject = object
    Blub: String[50];
    constructor Create;
    procedure ShowBlub;
  end;
.
.
.

implementation

procedure TForm1.FormCreate(Sender: TObject);
var
  Blub1, Blub2: TBlubObject;
begin
  Blub1 := TBlubObject.Create; // --> das geht nicht! 
  Blub1.ShowBlub;

  Blub2.Blub := 'Das ist Blub2';
  Blub2.ShowBlub;
end;

constructor TBlubObject.Create;
begin
  Blub := 'Schwachsinn';
end;

procedure TBlubObject.ShowBlub;
begin
  ShowMessage( Blub );
end;
  Mit Zitat antworten Zitat