Forum: Object-Pascal / Delphi-Language
Delphi
by Codehunter,
26. Sep 2018
Ist ja jetzt in der finalen Lösung auch keine Konstante mehr ;-)
Forum: Object-Pascal / Delphi-Language
Delphi
by Codehunter,
26. Sep 2018
Manchmal braucht es nur einen kleinen Schubs. Und der Uwe kann sehr effektiv schubsen ;-) Generics sind schon was feines. So funktionierts:type
TheItemKind = (ikNone, ikCheckBox, ikCheckListBox, ikComboBox, ikEdit, ikGroupBox, ikIPAddress, ikSpinEdit);
TheControlItemDef = record
Caption: string;
Kind: TheItemKind;
ConfigPath: string;
Childs: TArray<TheControlItemDef>;...
Forum: Object-Pascal / Delphi-Language
Delphi
by Codehunter,
26. Sep 2018
Na gut, ich bin ja auch nicht zwingend darauf angewiesen, das Ganze im Interface-Teil zu machen. Ich könnte mir das auch innerhalb einer class static function vorstellen. Schön wäre wenn man anhand der Quelltextstruktur auch schon die spätere Elementstruktur erkennbar wäre, wie hier mit ITEMDEFS beispielhaft gezeigt. Was könnte man dafür praktischerweise verwenden?
Forum: Object-Pascal / Delphi-Language
Delphi
by Codehunter,
26. Sep 2018
Hmmm... Das hier klappt aber:type
TheItemKind = (ikNone, ikCheckBox, ikCheckListBox, ikComboBox, ikEdit, ikGroupBox, ikIPAddress, ikSpinEdit);
TheControlItemDef = record
Caption: string;
Kind: TheItemKind;
KonfigPath: string;
Childs: array of TheControlItemDef;
end;
Forum: Object-Pascal / Delphi-Language
Delphi
by Codehunter,
26. Sep 2018
Hallo!
Ich möchte ein in sich verschachteltes array of record in einer Konstantendeklaration initialisieren. In der ersten Ebene kein Problem, in der zweiten mag der Compiler nicht mitziehen:type
TheItemKind = (ikNone, ikCheckBox, ikCheckListBox, ikComboBox, ikEdit, ikGroupBox, ikIPAddress, ikSpinEdit);
TheControlItemDef = record
Caption: string;
Kind: TheItemKind;
...