NWDSItrTypeDown

Sets the iterator position according to the specified attribute and value and implements “typedown.”

Local Servers:blocking
Remote Servers:blocking
NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NDS (NET*.*)
Service:NDS Iterator

Syntax

  #include <nwnet.h> 
  or 
  #include <nwitr.h> 
   
  NWDSCCODE  NWDSItrTypeDown ( 
     nuint_ptr   Iterator, 
     pnstr8      attrString, 
     pnstr8      value, 
     nuint32     byteUniFlag, 
     nuint32     timeout); 
  
  

Parameters

Iterator

(IN) Specifies the iterator object.

attrString

(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.

value

(IN) Specifies the string value to use for typedown positioning.

byteUniFlag

(IN) Specifies whether the input is a byte or Unicode string:

0

DS_ITR_UNICODE_STRING: Indicates a Unicode string.

2

DS_ITR_BYTE_STRING: Indicates a byte string.

timeout

(IN) Specifies the time (in milliseconds) allowed before returning an error.

Return Values

0x0000 0000

SUCCESSFUL

ERR_ITR_INVALID_HANDLE

Indicates the Iterator parameter was not a valid iterator object.

nonzero value

Nonzero values indicate errors. See NDS Return Values (-001 to -799).

Remarks

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.

NCP Calls

See Also

NWDSItrSetPosition, NWDSItrSetPositionFromIterator, NWDSItrGetPosition