Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Neue Klasse erstellen (https://www.delphipraxis.net/28143-neue-klasse-erstellen.html)

barnti 20. Aug 2004 06:49


Neue Klasse erstellen
 
Hallo,
hier mein Code:
Delphi-Quellcode:
unit Versioninfo;

interface
type
  TVersionInfo=class

  private
    function GetVersioninfo(Index: Integer): String;
  public
    constructor Create (ThisSourceFile: String);
    destructor Destroy; override;

    property Key[KeyName: String]: String read GetKey; // hier sagt der Compiler:
                                                        // [Error] Versioninfo.pas(13): Field or
                                                        // method identifier expected

    property CompanyName: String index 0 read GetVersionInfo write SetVersionInfo;
    property FileDescription: String index 1 read GetVersionInfo;
    property FileVersion: String index 2 read GetVersionInfo;
    property InternalName: String index 3 read GetVersionInfo;
    property Copyright: String index 4 read GetVersionInfo;
    property TradeMarks: String index 5 read GetVersionInfo;
    property OriginalFileName: String index 6 read GetVersionInfo;
    property ProductName: String index 7 read GetVersionInfo write SetVersionInfo;
    property ProductVersion: String index 8 read GetVersionInfo write SetVersionInfo;
    property Comments: String index 9 read GetVersionInfo;
    property BuildNumber: String read GetVersionInfo;
  end;

implementation

end.
Kann mir mal jemand auf die Srünge helfen, was ich falsch mache? Wie kann ich das Interface richtig implementieren?

geesmith 20. Aug 2004 06:55

Re: Neue Klasse erstellen
 
Tja barnti

Wo hast du denn eine Variable oder Funktion namens "GetKey"??

plumper 20. Aug 2004 07:02

Re: Neue Klasse erstellen
 
Schätze er wird bei 'SetVersionInfo' ebenfalls Probleme bekommen...

Sonnige Grüße,

Jens

barnti 20. Aug 2004 07:14

Re: Neue Klasse erstellen
 
Hi,
ok, is zu früh!
Habe ich inzwischen im Implementationsteil hinzugefügt! Sorry für die Mühe und Danke!

Bernhard Geyer 20. Aug 2004 07:18

Re: Neue Klasse erstellen
 
Falls Du dir das Coden sparen willst: In der Jedi Code Library gibt es die Fertige Klasse TJclFileVersionInfo

barnti 20. Aug 2004 07:22

Re: Neue Klasse erstellen
 
Hallo,

den Code hatte ich leider nur unvollständig. Deshalb meine Probleme! Jetzt kannn ich mal nachlesen.
Danke!


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:07 Uhr.

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