Autor Beitrag
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Fr 29.07.05 19:08 
Hallo,

es kann sein, dass ich bei der Suche einfach nur die Antwort auf meine Frage übersehen habe. Wenn das so ist, dann bitte ich um Verzeihung und um einen Link.

Ich möchte ein Array eines Formulares erstellen
ausblenden Delphi-Quelltext
1:
2:
TTopicEditor = class(TForm)
...

ausblenden Delphi-Quelltext
1:
2:
var
  TopicEditorWindows: array of TTopicEditor;

Wenn ich jetzt diesen hier mache:
ausblenden Delphi-Quelltext
1:
2:
i := high(TopicEditorWindows) + 1;
  TopicEditorWindows[i] := TTopicEditor.Create(self);

Dann kommt:
Fehler-MessageDlg hat folgendes geschrieben:
---------------------------
Jhc
---------------------------
Zugriffsverletzung bei Adresse 004638F3 in Modul 'JHC.exe'. Schreiben von Adresse 00000000.
---------------------------
OK
---------------------------

Also gehe ich mal davon aus, dass er auf was nicht instantiertes zugreifen will. Aber ich bin da ja gerade beim Create... Was soll ich nun damit machen?

Schonmal Danke im vorraus,
JayK
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Fr 29.07.05 19:21 
Nop. Du hast das Array einfach noch nicht größer gemacht:

ausblenden Delphi-Quelltext
1:
SetLength(TopicEditorWindows, high(TopicEditorWindows) + 1);					


Alstar
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 29.07.05 19:21 
ausblenden Delphi-Quelltext
1:
2:
3:
  i := length(TopicEditorWindows);
  setlength(TopicEditorWindows, i + 1);
  TopicEditorWindows[i] := TTopicEditor.Create(self);

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
JayK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Sa 30.07.05 22:11 
Danke. Jetzt klappt es. :-D