ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / LDAP functions
LDAPNbValue (Example)
The following example shows how to use LDAPNbValue recursively.
// Find the attributes
sListAttributes is string
sListAttributes = LDAPListAttribute("MySession", "DC=pcs,DC=local")
 
// Find the child elements
sListChildren is string
sListChildren = LDAPListChildren("MySession", "DC=pcs,DC=local")
 
// Find the attributes of the child elements
gFindSubChildrenAttributeNumber(sListChildren,sListAttributes, "DC=pcs,DC=local")
//============== recursive use of LDAPNbValue ==============
PROCÉDURE gFindSubChildrenAttributeNumber(sListC, sLitA, sDN)
sChildName is string
i is int = 1
j is int = 1
sListChildren is string
sListAttribute is string
nNumber is int
// Find the number of each attribute
sAttributeName = ExtractString(sListA, j, CR)
WHILE sAttributeName <> EOT
nNumber = LDAPNbValue("MySession", sDN, sAttributeName)
    // Add the attributes into the result
gsListAttributeNumber += sAttributeName + TAB + nNumber + CR
j += 1
sAttributeName = ExtractString(sListA, j, CR)
END
sChildName = ExtractString(sListC, i, CR)
WHILE sChildName <> EOT
// Find the attributes of the child elements
sListAttributes is string
sListAttributes = LDAPListAttribute("MySession", sChildName)
// Perform the same operation with the children of the child element
sListChildren = LDAPListChildren("MySession", sChildName)
IF sListChildren <> "" THEN
gFindSubChildrenAttributeNumber(sListChildren, sListAttributes, sChildName)
ELSE
// Find the number of each attribute
j = 1
sAttributeName = ExtractString(sListAttributes, j, CR)
WHILE sAttributeName <> EOT
nNumber = LDAPNbValue("MySession", sChildName, sAttributeName)
// Add the attributes into the result
gsListAttributeNumber += sAttributeName + TAB + nNumber + CR
  j += 1
sAttributeName = ExtractString(sListAttributes, j, CR)
END
END
i += 1
sChildName = ExtractString(sListC, i, CR)
END
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help