slot_subarray
Behaviour
Section titled “Behaviour”- Look up the array in slot
parent_slot
- Retrieve the sub-object at the index specified in
array_id
- Place sub-object into the slot
new_slot
or the next available slot ifnew_slot
is 0. - Return the new slot number.
- Creates a subarray in the specified parent slot.
- Returns an error code or the result of the subarray creation.
Definition
Section titled “Definition”int64_t slot_subarray ( uint32_t parent_slot, uint32_t array_id, uint32_t new_slot);
function slot_subarray( parent_slotno: number, array_id: number, new_slotno: number ): ErrorCode | number
Example
Section titled “Example”int64_t subslot = 0;subslot = slot_subarray(slot_no, i, (uint32_t)subslot);
let subslot = 0subslot = slot_subarray(slot_no, i, subslot)
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
parent_slot | uint32_t | Slot the parent array is in |
array_id | uint32_t | The |
new_slot | uint32_t | New slot number to place the object from the selected array index into. If null, choose the next available slot. May be null. |
Name | Type | Description |
---|---|---|
parent_slotno | number | The parent slot number. |
array_id | number | The ID of the array to create a subarray for. |
new_slotno | number | The new slot number for the subarray. |
Return Code
Section titled “Return Code”Type | Description |
---|---|
int64_t | The slot number of the newly allocated object |
Type | Description |
---|---|
number | Returns an error code or the result of the subarray creation. |