Var
i : Integer;
j : Integer;
oSLArray : array of TStringList;
oSL : TStringList;
begin
SetLength(oSLArray, emailPassword.Lines.Count);
for i := 0 to emailPassword.Lines.Count - 1 do
{oSLArray[i] := TStringList.Create;
oSLArray[i].Delimiter := ' ';
oSLArray[i].DelimitedText := emailPassword.Lines[i];
for j := 0 to oSLArray[i].Count-1 do begin
Showmessage( oSLArray[i].Strings[j] );
end; }
oSL := TStringList.Create;
oSL.Delimiter := ' ';
oSL.DelimitedText := emailPassword.Lines[i];
for j := 0 to oSL.Count-1 do begin
Showmessage( oSL[j] );
end;
end;
I'm trying to make an array of TStringLists, read what's coming from the RichEdit 'EmailPassword', and then print it (I will put it in an array when I get that far).
When I uncomment out oSLarray, I get an access violation. When I tried it with oSL, nothing printed.
Now, I understand an access violation means the pointer may not be set properly, as I think the access violation is occurring at oSLArray[i] := TStringList.Create.
Am I just missing something small?