Autor Beitrag
violinenspieler1000
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Fr 17.07.09 15:02 
Hallo,

ich habe unter type einen eigenen Datentyp der folgenden Form angelegt:
ausblenden Delphi-Quelltext
1:
2:
type
matrix=array[0..60..5of integer;


Will ich nun lokal in einer Methode eine Variable vom Typ Matrix erstellen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Methode;
var
mymatrix: matrix;
begin
end;


Erhalte ich folgenden Fehler:
[/quote][Fehler] pprogram.pas(91): E2007 Konstante oder Typenbezeichner erwartet[quote]

Was kann ich dagegen machen?
oki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP
Delphi 2007 Prof
BeitragVerfasst: Fr 17.07.09 15:11 
An welcher Stelle hast du matrix definiert?

Gruß oki

_________________
42
violinenspieler1000 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Fr 17.07.09 15:16 
Über der Klassendefinition:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
type
  matrix=array[0..60..5of integer;
  TForm1 = class(TForm)
    Image1: TImage;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8553
Erhaltene Danke: 479

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 17.07.09 15:20 
Kleiner Hinweis am Rande: Typen sollten immer mit einem "T" beginnen. Diese Konvention erweist sich später als sehr hilfreich - evtl. sogar schon hier, wenn man dann
var Matrix: TMatrix; nehmen kann. ;-)

Bei mir (Delphi7) funktioniert der Code soweit. Hast du denn procedure TForm1.Methode; auch in der Typ-Deklaration der Formklasse stehen?

_________________
We are, we were and will not be.
oki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP
Delphi 2007 Prof
BeitragVerfasst: Fr 17.07.09 15:54 
Bist du dir sicher, dass das wirklich der Fehler ist, der angemeckert wird? Dein Code-Sniped aus deinem ersten Post scheint mir nicht dein Originalcode zu sein. Kopier mal den Originalcode hier rein. Manchmal beseitigt man beim Abtippen ungewollt den eigentlichen Fehler :-)

Gruß oki

_________________
42