Index into a slotted array and assign a sub-object to another slot
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_slotor the next available slot ifnew_slotis 0.
- Return the new slot number.
Definition
int64_t slot_subarray (
    uint32_t parent_slot,
  	uint32_t array_id,
  	uint32_t new_slot
);
Example
int64_t subslot = 0;
subslot =
    slot_subarray(slot_no, i, (uint32_t)subslot);
Parameters
| Name | Type | Description | 
|---|---|---|
| parent_slot | uint32_t | Slot the parent array is in | 
| array_id | uint32_t | The sfcode of the field you are searching for.To compute this manually take the serialized typeand shift it into the 16 highest bits of uint32_t, then take thefieldand place it in the 16 lowest bits.For example: sfEmitNoncehastype5 andfield11 thus its value is0x050BU | 
| 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. | 
Return Code
| Type | Description | 
|---|---|
| int64_t | The slot number of the newly allocated object If negative, an error: DOESNT_EXIST- The specified array_iddoesn't exist in the array pointed to byparent_slotNO_FREE_SLOTS- The API would require a new slot to be allocated but the Hook is already at the maximum number of slots. NOT_AN_ARRAY- The specified parent_slotdoes not contain an STArray. |