Description
Copies a byte buffer from the CTBUFFLST instance at a specified index location into another buffer. The supplied buffer must NOT be a CTBUFF instance. For example, this could be an ALPHA field or a byte buffer allocated by the caller using %Alloc.
Prototype
DCTBUFFLST_GetValue...
D PR 10I 0
D@This * Value
D@ValBuff * Value
D@Size 10I 0
D@Index 10I 0 Value
Parameters
@This
Type | Pointer (*) |
Passing Mode | Value |
Description | The address of an CTBUFFLST instance. This pointer MUST be obtained through a call to CTBUFFLST_Constructor. |
@ValBuff
Type | Pointer (*) |
Passing Mode | Value |
Description | The address of a user-supplied buffer. Don't use a CTBUFF instance; this will likely corrupt it. The user-supplied buffer can be a local variable of any type (as long as you know in advance what is held in the byte buffer) or a buffer resulting from a call to %Alloc. |
@Size
Type | 10I 0 |
Passing Mode | Reference |
Description | The size in bytes of the buffer pointed to by the @ValBuff parameter. On return, this parameter will hold the actual size of the requested byte buffer. 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 CTBUFFLST instance if the supplied buffer is too large. |
@Index
Type | 10I 0 |
Passing Mode | Value |
Description | The index of the requested byte buffer within the CTBUFFLST instance. The first byte buffer is located at index 1. |
Return Values
Symbolic Constant | Value | Description |
CS_SUCCESS | 0 | The byte buffer has successfully been copied into the supplied buffer. |
CS_FAILURE | 1 | The byte buffer has not been copied. This is either because the index is out of range or because the @ValBuff parameter is *null or the @Size parameter is zero. |