Description
Updates the value of an item within the lsit at a specified index location.
Prototype
DCTLST_Set...
D PR 10I 0
D@This * Value
D@Value * Value
D@Bytes 10I 0 Value
D@Index 10I 0 Value
Parameters
@This
Type | Pointer (*) |
Passing Mode | Value |
Description | The address of a linked list instance. This pointer MUST be obtained through a call to CTLST_Constructor. |
@Value
Type | Pointer (*) |
Passing Mode | Value |
Description | The address of a user-supplied buffer. The user-supplied buffer can be a local variable of any type or a buffer resulting from a call to %Alloc. |
@Bytes
Type | 10I 0 |
Passing Mode | Value |
Description | The size in bytes of the buffer pointed to by the @Value parameter. On return, this parameter will hold the actual size of the requested list item. This way, the caller can know if the supplied buffer wasn't large enough or how many bytes in the supplied buffer are those from the CTLST instance if the supplied buffer is too large. |
@Index
Type | 10I 0 |
Passing Mode | Value |
Description | The index position of the byte buffer within the CTLST instance. The first item in the list is located at index 1 (or CTLST_TOP). If you want to insert at the end of the list, you must specify CTLST_BOTTOM. If you specify an index out of range, the item will not be inserted (copied). |
Return Values
Symbolic Constant | Value | Description |
CS_SUCCESS | 0 | The list item has been updated successfully. |
CS_FAILURE | 1 | The item could not be updated due to an invalid index (the index is either out of range or the list is empty). |