Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Function in Unit / Zugriff von anderen Units (https://www.delphipraxis.net/78489-function-unit-zugriff-von-anderen-units.html)

mkinzler 5. Okt 2006 21:26

Re: Function in Unit / Zugriff von anderen Units
 
Zitat:

Zitat von Tormentor32
Jetzt habe ich ungenügende Forward oder External-Deklaration!

Poste nochmal die neue Unit

Tormentor32 5. Okt 2006 21:29

Re: Function in Unit / Zugriff von anderen Units
 
Delphi-Quellcode:
unit mTlocation;

interface
  // Wenn ich die function hier deklariere kennt er TFeldInhalt nicht
uses
  extctrls;


type

  TFeldInhalt = (Boden, Mauer, TrOnEnter, TrOnUse, TrOnCollision, TrChangeLoc,_);

  TFigurenImage = class(TImage)
  private
    FX: integer;
    FY: integer;
  public
    {funktionen *********************************}
    function GetXWert: integer;
    function GetYWert: integer;
    {prozeduren *********************************}
    procedure SetXWert(value: integer);
    procedure SetYWert(value: integer);
  end;

  TFeld = class(Tobject)
    FigurenImage: TFigurenimage;
  private
    FFigurenIndex: integer;
    FInhalt: TFeldInhalt;
    FID: string;
  public
    {funktionen *********************************}
    function GetFigurenIndex: integer;
    function GetInhalt: TFeldInhalt;
    function GetID: string;
    {prozeduren *********************************}
    procedure SetFigurenIndex(value: integer);
    procedure SetInhalt(value: TFeldInhalt);
    procedure SetID(value: string);
  end;

  TLocation = class(Tobject)
  private
  public
    Felder: array[1..20,1..20] of TFeld;
  end;

  //Hier Habe ich besagten Error
  function InhatlToStr(I: TFeldInhalt): string;

implementation

function InhaltToStr(I: TFeldInhalt): string;
begin
  case I of
    Boden:         result := 'StGrd';
    Mauer:         result := 'StWal';
    TrOnEnter:     result := 'TrOnE';
    TrOnUse:       result := 'TrOnU';
    TrOnCollision: result := 'TrOnC';
  else
    result := ''
  end
end;

// [..]

end.

mkinzler 5. Okt 2006 21:32

Re: Function in Unit / Zugriff von anderen Units
 
Du hast die function falsch geschrieben

function InhatlToStr(I: TFeldInhalt): string;

Tormentor32 5. Okt 2006 21:34

Re: Function in Unit / Zugriff von anderen Units
 
Das gibts doch nicht ! :wall: :wall: :wall: :wall: :wall: :wall: :wall:
Da hängt man ne stunde über so ner banalen sache und dann stellt sich raus, dass es ein RECHTSCHREIBFEHLER ist...

Naja vielen Dank für die schnelle Hilfe

Richard


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:39 Uhr.
Seite 2 von 2     12   

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