From f7baff65b4197b5eb24ce61918af93ebf24b8b55 Mon Sep 17 00:00:00 2001 From: geby Date: Fri, 5 Feb 2010 17:01:37 +0000 Subject: [PATCH] new method Get of TLDAPAttributeList git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@124 7c85be65-684b-0410-a082-b2ed4fbef004 --- ldapsend.pas | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ldapsend.pas b/ldapsend.pas index c696a45..ece52d6 100644 --- a/ldapsend.pas +++ b/ldapsend.pas @@ -1,5 +1,5 @@ {==============================================================================| -| Project : Ararat Synapse | 001.006.002 | +| Project : Ararat Synapse | 001.007.000 | |==============================================================================| | Content: LDAP client | |==============================================================================| @@ -129,6 +129,8 @@ type procedure Del(Index: integer); {:Find and return attribute with requested name. Returns nil if not found.} function Find(AttributeName: AnsiString): TLDAPAttribute; + {:Find and return attribute value with requested name. Returns empty string if not found.} + function Get(AttributeName: AnsiString): string; {:List of TLDAPAttribute objects.} property Items[Index: Integer]: TLDAPAttribute read GetAttribute; default; end; @@ -396,6 +398,17 @@ begin Result := FAttributeList.Count; end; +function TLDAPAttributeList.Get(AttributeName: AnsiString): string; +var + x: TLDAPAttribute; +begin + Result := ''; + x := self.Find(AttributeName); + if x <> nil then + if x.Count > 0 then + Result := x[0]; +end; + function TLDAPAttributeList.GetAttribute(Index: integer): TLDAPAttribute; begin Result := nil;