Hallo,
dafür kannst du Dynamische Arrays verwenden:
Quelltext
1: 2:
| x:= IntToStr(Edit1.Text); Setlength(GlobalesArray, x); |
Globales Array deklarierst du dir am besten Objecltglobal (also als Eigenscahft deines Objektes) aber ohne Längenenangabe z.B. so:
Quelltext
1: 2:
| protected GlobalesArray : ARRAY OF Integer; |
Das ganze solltest du nch mit ein paar Sicherheitsmechanismen versehen (länge nicht ändern wenn es schon eine hat usw.
Gruß
Klabautermann
PS: In Pascal ist es Prinzipiell nicht möglich Variablen im Anweisungsblock zu definieren.