Description
Retrieves the next available map item in keyed order within an iteration loop. The map value is copied in a caller-supplied buffer. Do not use a CTBUFF instance. Use the address of a local variable or the address of a buffer allocated with a call to %Alloc.
Prototype
DCTMAPX_IterNext...
D PR 10I 0
D@This * Value
D@Key * Value
D@KeySize 10I 0
D@Value * Value
D@ValueSize 10I 0
Parameters
@This
Type | Pointer (*) |
Passing Mode | Value |
Description | The address of a CTMAPX instance. This pointer MUST be obtained through a call to CMAPX_Constructor. |
@Key
Type | Pointer (*) |
Passing Mode | Value |
Description | The address of a the caller-supplied buffer that contains the key value associated with the map item. |
@KeySize
Type | 10I 0 |
Passing Mode | Reference |
Description | This is an IN/OUT parameter. On input, this holds the maximum number of bytes to copy in the buffer that will hold the key value (including the NULL terminator). On return, this parameter will hold the actual item's key size (including the NULL terminator). This happens to be the nmber of bytes copied into the @Key parameter. |
@Value
Type | Pointer (*) |
Passing Mode | Value |
Description | The address of a caller-supplied buffer. Don't use a CTBUFF instance. This buffer can be a local variable or a buffer allocated with a call to %Alloc. |
@ValueSize
Type | 10I 0 |
Passing Mode | Value |
Description | The size in bytes of the @Value parameter. On return, this paramter will hold the actual size of the retrieved item. If the supplied buffer is too small, then only @ValueSize bytes have been copied so as to not overflow the supplied buffer. If the supplied buffer is larger than the map item, then, on return, this parameter holds the number of bytes that were actually copied into the supplied buffer (which happens to be the item's real size). |
Return Values
Symbolic Constant | Value | Description |
CS_SUCCESS | 0 | The next map item has been returned successfully. |
CS_FAILURE | 1 | We are at the end of the list. Another possibility is that the key size is smaller than the actual item key size. The @KeySize parameter will hold the actual key size on return. |