maybe the code wasn´t working because it´s an unfixed array
(the write and read you posted)
The code posted by who? My code? It does work, I tested it a little later. If it doesn't work for you, tell us what it is
not doing which it should and/or what it
is doing that it shouldn't, with as much detail as you can.
And, what do you mean by "unfixed", a
dynamic array? It shouldn't matter; except for the need to set its length before accessing its elements (and other, more esoteric things which don't matter here) it works exactly like a normal static array.
The only difference between your code and the same but using a dynamic array is the highlighted line:
unit Unit1;
interface
{ skipped declarations here }
implementation
const
n=30;
var
TheStrings: TStringArray;
{$R *.dfm}
procedure load(var TheStrings: TStringArray);
var
i:integer;
begin
{it starts from zero, but you want it from 1,
so we add one for it to go from 0 to 30 and
avoid using TheStrings[0]}
SetLength(TheStrings, n+1);
TheStrings[1] := 'First string in this Array';
{... etc ...}
TheStrings[30] := 'String number three of this Array';
for i:=1 to n do begin
showmessage(TheStrings[i]);
end;
end;