Sets the iterator position according to the specified attribute and value and implements “typedown.”
#include <nwnet.h>
or
#include <nwitr.h>
NWDSCCODE NWDSItrTypeDown (
nuint_ptr Iterator,
pnstr8 attrString,
pnstr8 value,
nuint32 byteUniFlag,
nuint32 timeout);
(IN) Specifies the iterator object.
(IN) Specifies the attribute to use for typedown. It is usually set to NULL to select the default attribute for the index of the iterator object.
(IN) Specifies the string value to use for typedown positioning.
(IN) Specifies whether the input is a byte or Unicode string:
(IN) Specifies the time (in milliseconds) allowed before returning an error.
|
0x0000 0000 |
SUCCESSFUL |
|
ERR_ITR_INVALID_HANDLE |
Indicates the Iterator parameter was not a valid iterator object. |
|
nonzero value |
Nonzero values indicate errors. See |
If you have a list sorted by surname, you can specify “D” and it will position to the first name starting with D. If you specify “DA”, it positions to the first name starting with DA, etc. If there are no entries matching the value string, it positions to the first one that is greater than the specified value. If no entries have a greater value, the position is set to EOF.
If you have set context handle flags with the NWDSSetContext function, the byteUniFlag parameter can use the flags parameter from the NWDSSetContext function as its value.
This function can give unexpected results when used with the _BaseClass,_RDN index if the search filter allows for multiple base classes. The index sorts objects first by base class and then alphabetically within the class. For example, an index of the following groups and users would produce unexpected results.
Groups
Cat Lovers
Dog Lovers
Horse Lovers
Users
Ann
Chris
Don
Kim
Zed
A typedown of "Chr" would position the iterator on "Dog Lovers," the first object it finds with a value greater than "Cat Lovers" object. However, a typedown of "Ki" would position the iterator on Kim. If the Group base class had an entry of "Zebra Lovers," only users with names that started with a value greater than "Zebra Lovers" (such as Zed) could be returned on a typedown.
For sample code, see Section 4.8, Positioning the Iterator with Typedown: Example.