Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Do 08.06.06 19:11 
Ich schreibe eine eigene Klasse. Ich habe dieses Array of record als private folgendermaßen deklariert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 FEingabeArray : array of record
        Combobox_fach : TCombobox;
        button_loeschen : TButton;
        array_edit : array[1..5] of TEdit;
 end;

Ich verstehe nicht, warum Delphi dort ein : statt eines = akzeptiert :shock:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 08.06.06 19:15 
Ganz einfach, weil Delphi an dieser Stelle eine Variablen-Deklaration Name: Typ erwartet und Du als Typ inline dein Array eines Record-Typen deklarierst.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Do 08.06.06 19:18 
user profile iconBenBE hat folgendes geschrieben:
weil Delphi an dieser Stelle eine Variablen-Deklaration Name: Typ erwartet

Ist verstanden :zustimm:
user profile iconBenBE hat folgendes geschrieben:
und Du als Typ inline dein Array eines Record-Typen deklarierst.

Kannst das bitte nochmal einfacher erklären? ;)

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 08.06.06 19:23 
k, ich versuch's idotensicher: Du deklarierst dort einen (anonymen\unbenannten) Typ.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Do 08.06.06 19:25 
Naja sagen wir es mal so, ich verstehe schon was du mit den 'inline' meinst, aber ich verstehe nicht, inwiefern das eine Begründung für den Doppelpunkt sein soll/ist.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Do 08.06.06 19:28 
Ich denke nicht das es dafür eine Erklärung gibt, es ist halt einfach so...

Genauso wie das Universum existiert, zerbrech dir den Kopf drüber oder lass es einfach da sein...

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Do 08.06.06 19:39 
Ich stells mir so vor:
Typen sind ja fast wie Stellvertreter. Genau wie Funktionen, die sind ja immer stellvertretend (und ganz nebenbei codesparend ^^) für ihre Implementation, die könnte man ja immer wieder neu tippen, wäre dasselbe. Jetzt kann man eben auch id: TypIdentifier oder id: {Typdeklaration} schreiben...
Das
ausblenden Delphi-Quelltext
1:
2:
3:
record
 ...
end;

ist ja deine definition für den Recordtyp. Du hättest ja auch das Record sonstwo mit Namen TTypId deklarieren können
ausblenden Delphi-Quelltext
1:
2:
3:
4:
type
  record TTypId
  ...
  end;

und dann FEingabeArray: TTypId wieder schreiben können. Sozusagen könnte man sich denken, wenn man es ganz einfach und bestimmt nicht korrekt betrachtet, der Typidentifizierer wird da immer durch die Deklaration ersetzt.

Man möge mich bitte korrigieren, wenn es völlig falsch ist. ;)

|EDIT: hab mal lieber deinen variablennamen verwendet im letzten codeschnipsel ;)