Share this page

# mldap_get_attrib_value

Listing Directory Functions (mldap)

Gets the value of the specified attribute.

    char *mldap_get_attrib_value( char *transaction, char *name, char *index, [char *offset,] [char *param,] LAST );

transaction | A transaction name for this step. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
name | The name of the attribute. Specify either name or index, not both.Use the format: `Name=`attribute_name
index | The index of the attribute. Specify either name or index, not both. Use the format: `Index=`attribute_number
offset | The zero-based offset of the attribute value. For the first value of an attribute (default), specify a 0. Use the format: `offset=`offset
param | The name of a parameter storing the value. Use the following format: `"Param=`name`"`
LAST | A marker indicating the end of the argument list.

The mldap_get_attrib_value function retrieves the value of an attribute of the current entry. You can specify either the index of an attribute or its name. By default, if nothing is specified, the function returns the value of the first attribute. The optional offset argument lets you get an attribute value other than the first. For example, if an attribute has multiple values, an offset of 0 would return the first value, an offset of 1 would return the second, etc.

This function is for use with global sessions. For multiple sessions, use the mldap_get_attrib_value_ex function, which allows you to specify a session identifier.

This function is not recorded. Add it if needed when enhancing your script.

## Return Values

This function returns the attribute value, or NULL if no entries are available or if there is an error.

## Parameterization

The following argument(s) can be parameterized with standard parameterization: name, index, offset, paramtext

## Example

In the following example, the mldap_get_attrib_value function gets the value of the objectClass attribute.

Copy code

    while (mldap_get_next_entry("LDAP Get Next Entry", LAST)) {
             mldap_get_attrib_value("LDAP Get Attribute Value",
             "Name=objectClass",
             LAST );
        }

In the following example, mldap_get_attrib_value retrieves the third value of the attribute with an index of 13 (13th attribute) and saves it to parameter xyz.

Copy code

    mldap_get_attrib_value("LDAP Get Attribute Value",
         "Index=13",
         "Offset=2",    // Return the third value
         "Param=xyz",    // Save return value to parameter <i>xyz</i>
         LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: