Without all the chaff so that you can read it :)

Option 1 ( my preference )

If findmatch(Alist,Astatus,Aitem) then
Begin
  //  Aitem Exists and do something
End else
Begin
  // Aitem doesn't exist so do handling
End;

Option 2 ( lengthier )

Aitem := findmatch(Alist,Astatus);
If assigned(Aitem) then
Begin
  // do something with AItem
End else
Begin
  // Aitem doesn't exist so do handling
End;

Option 3 ( lengthiest )

AitemIndex := findmatch(Alist,Astatus);
If AItemIndex <> -1 then
Begin
  Aitem := Alist[AItemIndex]
  // do something with AItem
End else
Begin
  // Aitem doesn't exist so do handling
End;

Nothing wrong with any really, comes down to preference

---------------------------------------------------------------------------
    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