|
|
|
|
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
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|