BdLm
asked on
TStringList: Check before adding Strings
Before adding strings to a stringlist, I checked if the Stringlsit is assigned with thios code:
Var LogStr : TStringList;
somewhere else:
.....
if not assigned (LogStr) then LogStr:=TStringList.Create ;
LogStr.Add('<h2> Misalignment check </h2>');
or here .....
procedure TMainForm.DisplayStatusTex t(InfoText : String);
begin
if Assigned (LogStr) then
LogStr.Add('<br> ' + Infotext);
end;
Why does the assigned check don't give me a working check if I aleady did a LogStr.Free ?
Var LogStr : TStringList;
somewhere else:
.....
if not assigned (LogStr) then LogStr:=TStringList.Create
LogStr.Add('<h2> Misalignment check </h2>');
or here .....
procedure TMainForm.DisplayStatusTex
begin
if Assigned (LogStr) then
LogStr.Add('<br> ' + Infotext);
end;
Why does the assigned check don't give me a working check if I aleady did a LogStr.Free ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.