AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones LDAP
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 ==============
PROCEDURE 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
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local