NWDSItrGetPosition

Returns the iterator’s current logical position.

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  NWDSItrGetPosition ( 
     nuint_ptr    Iterator, 
     pnuint32     pPosition, 
     nuint32      timeout); 
  
  

Parameters

Iterator

(IN) Specifies the iterator object.

pPosition

(OUT) Returns the current iterator position as a logical position in the 0-1000 range or DS_ITR_EOF (1001). The value is an approximation.

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.

ERR_EOF_HIT

Indicates that current position is beyond the last entry in the list.This is a valid position.

ERR_NOT_IMPLEMENTED

Indicates that this iterator object does not support positioning. For more information, see the NWDSItrGetInfo function.

nonzero value

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

Remarks

Unless the iterator object is on one of the special positions, the position returned is an estimate, not an exact location. For more information, see Section 1.4, Positions of an Iterator Object.

The following values indicate special positions for the pPosition parameter:

0 (DS_ITR_FIRST)

Indicates the current position is at the top of the list

1000 (DS_ITR_LAST)

Indicates the current position is at the last entry in the list

1001 (DS_ITR_EOF)

Indicates the position is at EOF, or just after the last entry in the list

If the position is at EOF, DS_ITR_EOF (1001) is returned for the position and 0 is returned as the status code.

Not all iterator objects are positionable. Such iterator objects return an error code (ERR_NOT_IMPLEMENTED). To determine if the iterator object supports positioning, see the NWDSItrGetInfo function.

For sample code, see Section 4.6, Getting and Setting the Iterator's Position: Example.

NCP Calls

See Also

NWDSItrAtEOF, NWDSItrAtFirst, NWDSItrSetPosition, NWDSItrSetPositionFromIterator