Autor Beitrag
Masterrandy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 13.07.05 11:07 
Hallo,

ich erhalte die Fehlermeldung: "Identifier expected but 'IMPLEMENTATION' found"
Ich will die Komponente in Delphi 5 Ent. kompilieren. In Delphi 3 Pro funktioniert das ohne Probleme.

Das ist der Anfang der Datei. Bei "implementation" unten tritt der Fehler auf.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
{$I DFS.INC}  { Standard defines for all Delphi Free Stuff components }

unit GradFormReg;

{$IFNDEF DFS_WIN32}
  Error!  This unit is only available for Win32.
{$ENDIF}

interface

uses
  {$IFDEF DFS_COMPILER_3_UP} ExptIntf, EditIntf, {$ENDIF}
  Windows, SysUtils, StdCtrls, GradForm, Consts; // DFSAbout,

const
  { This is the name of the page in the Object Repository (File | New) that the
    form expert will be created on.  I chose DFS (for Delphi Free Stuff) so
    that it remained seperate from the standard items in the repository.
    However, you may find it more convenient to change this string to 'Forms'
    so that it shows up with all the other new types of forms you have in the
    repository. }

  // The page name for the Gradient Form Wizard
  sGradFormObjRepositoryPage = 'DFS';
  // The page name for the Gradient Form Project wizard
  sGradFormProjObjRepositoryPage = 'DFS';

type

{$IFDEF DFS_COMPILER_3_UP}
  {: Registers the class for use in the IDE of Delphi 3, 4, and C++Builder.
     Previous versions of Delphi and C++Builder 1.0 do <B>NOT</B>
     support design-time access of TForm descendants.  Sorry.  Unlike a normal
     component, TForm descendant classes must have an expert that creates the
     custom form instance for the process to work. }

  { The IDE expert that allows the class to work at design-time in the IDE }
  TGradientFormExpert = class(TIExpert)
  public
    function GetStyle: TExpertStyle; override;
    function GetName: stringoverride;
    function GetAuthor: stringoverride;
    function GetComment: stringoverride;
    function GetPage: stringoverride;
    function GetGlyph: HICON; override;
    function GetState: TExpertState; override;
    function GetIDString: stringoverride;
    function GetMenuText: stringoverride;
    procedure Execute; override;
  end;

{$IFDEF DFS_DELPHI_3_UP}
  { Generating a project file for C++Builder is more work than I want to
    even try.  If somone has a go at this, let me know. }

  TGradientFormProjectExpert = class(TIExpert)
  public
    function GetStyle: TExpertStyle; override;
    function GetName: stringoverride;
    function GetAuthor: stringoverride;
    function GetComment: stringoverride;
    function GetPage: stringoverride;
    function GetGlyph: HICON; override;
    function GetState: TExpertState; override;
    function GetIDString: stringoverride;
    function GetMenuText: stringoverride;
    procedure Execute; override;
  end;

  TGradientFormProjectCreator = class(TIProjectCreator)
  public
    function Existing: boolean; override;
    function GetFileName: stringoverride;
    function GetFileSystem: stringoverride;
    function NewProjectSource(const ProjectName: string): stringoverride;
    procedure NewDefaultModule; override;
    procedure NewProjectResource(Module: TIModuleInterface); override;
  end;
{$ENDIF}

  procedure Register;
{$ENDIF}


implementation  //Hier entsteht die Fehlermeldung

{$IFDEF DFS_COMPILER_3_UP}
uses
  ToolIntf, DsgnIntf, TypInfo;


const
  CRLF = #13#10;


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 13.07.05 12:03 
Da ist ein kleiner Fehler mit den Compilerbedingungen. Ändere mal die folgenden Zeilen:
ausblenden Delphi-Quelltext
 
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
{ ... }
  sGradFormObjRepositoryPage = 'DFS';
  // The page name for the Gradient Form Project wizard
  sGradFormProjObjRepositoryPage = 'DFS';

{$IFDEF DFS_COMPILER_3_UP}

type


  {: Registers the class for use in the IDE of Delphi 3, 4, and C++Builder.
     Previous versions of Delphi and C++Builder 1.0 do <B>NOT</B>
     support design-time access of TForm descendants.  Sorry.  Unlike a normal
     component, TForm descendant classes must have an expert that creates the
     custom form instance for the process to work. }

  { The IDE expert that allows the class to work at design-time in the IDE }
  TGradientFormExpert = class(TIExpert)

[...]
Masterrandy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 13.07.05 12:47 
Ok, da scheint was dran zu sein.

jetzt geht der Compiler bis zum Ende und sagt:

-"IMPLEMENTATION expected but '.' found" //beim "end."
-"Decleration expected but end of file found"

Kann es sein, dass nichts kompiliert wird in D5, wegen den ganzen compile-Bedingungen die auf Delphi3 und D3_up beruhen?
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mi 13.07.05 13:01 
Gibt es hierzu :

ausblenden Delphi-Quelltext
1:
{$IFDEF DFS_COMPILER_3_UP}					


auch ein $ENDIF ?

Die Fehlermeldung ist in diesem Falle auch aussagekräftig ! Poste mal das Ende der Unit und in 10 Min. ist das wohl erledigt.

_________________
Gruß
Hansa
Masterrandy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 13.07.05 13:15 
Hi,

habe das Problem gelöst. Am Anfang wird eine Datei inkludiert. Diese Definiert alle Delphi-Versionen (also die Konstanten wie DFS_COMPILER_3_UP), aber leider nur bis zu 4. Ich habe aber die 5. Hab das jetzt noch eingefügt. Jetzt tut es wie es soll ^^

Danke für die Hilfe