What should the TIniFiles initial state be after defining in a procedure/function?

What should the TIniFiles initial state be after defining in a procedure/function? Shouldn't the value assigned to a Tinifile be nil at the start?

When calling this example passing FALSE, the check for not assigned comes up true, yet it isn't. Now if I pass TRUE and manually initialize value to Nil, I'm ok.

This is Delphi 10 Seattle Update 1.

procedure IniWrite(NilFirst: boolean);
var
Ini1: tinifile;
begin
if NilFirst then
Ini1:= nil;

if not(assigned(Ini1)) then
Ini1 := TInifile.Create(IFILE);

try
Ini1.WriteString('xyz','a','TEST');
finally
Ini1.Free;
end;

end;

Comments