Autor Beitrag
sky21
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 141

W7
D2010, XE2
BeitragVerfasst: Di 06.06.06 15:45 
Hallo

Hier hab ich den folgenden Code....
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
  Engine = class
  public
    const ModuleID = 32;
    const ModuleName = 'Engine';
    type
      ErrorCode = class
      public
        const Measurement = 0;
    end;
  end;


Jetzt, wie kann ich auf die Konstante 'Measurement' zugreiffen?

so geht nicht wie ich eigentlich dachte ...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
 en : Engine;
 i : Integer;
begin
 en := Engine.Create;
 i := en.Errorcode.Measurement; // geht nicht ....
end;



any help? please....
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 06.06.06 15:59 
Versuchs mal so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
type
    EC = class
      public
        const Measurement = 0;
    end;

    Engine = class
      public
        const ModuleID = 32;
        const ModuleName = 'Engine';
        ErrorCode: EC;
  end;

_________________
Markus Kinzler.