[Lazarus] Testing Assigned object

SteveG steveg at nevets.com.au
Mon Apr 25 09:04:15 CEST 2011


Is there a simple way to tell if slTest has been assigned in the following ?

(without specifically assigning it to NIL in the declaration)

var
   slTest 	:TStringList;

begin
   if Assigned(slTest) then FreeAndNil(slTest); // gives exception
end;

Thanks - SteveG







More information about the Lazarus mailing list