This is better

  if Assigned (Datasource.DataSet.Connection)
  then Result := Datasource.DataSet.Connection;


> Hi all
> 
> If you are following a trail of properties, ie Datasource.DataSet.Connection
> is it be to test for assignment/nil a each step or
> just try except it?
> 
> ie
>   if (Datasource <> nil) and
>      (Datasource.DataSet <> nil) and
>      (Datasource.DataSet.Connection <> nil)
>   then Result := Datasource.DataSet.Connection
>   else Result := nil;
> or
> 
> try
>   Result := Datasource.DataSet.Connection
> except
>   Result := nil
> end;
> 
> 
>  Regards Neven
>  N.K. MacEwan B.E. E&E
>  Ph 649 574 0027
>  Fax 649 570 2706
>  [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED] 
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> 



Sandeep

Software Developer
CFL
[EMAIL PROTECTED]
http://www.cfl.co.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to