Sets an element into an SRP List at the given index position.
Syntax
SRP_List("SetAt", Handle, Index, Element)
Parameters
Parameter | Description |
---|---|
Handle | Handle to an existing SRP List (REQUIRED) |
Index | The position within the SRP List at which the element will be placed (REQUIRED) |
Element | The value to insert into the SRP List (REQUIRED) |
Remarks
The SetAt service sets a value into an SRP List at the given position. It differs from the InsertAt service in that it will replace the element at that location if one already exists. You can set Index to any positive integer and the list will grow to accomodate it. So, if you have a list with 10 elements and set a new element at Index 100, then the list will grow to 100 elements large with your new element in the last position.
Examples
// Create the list Handle = SRP_List("Create") // Set elements at several locations SRP_List("SetAt", Handle, 1, "ABC") SRP_List("SetAt", Handle, 5, "DEF") SRP_List("SetAt", Handle, 1, "EFG") // Convert the SRP List into a normal list List = SRP_List("GetVariable", Handle, ",") // List = "EFG,,,,DEF" // Play nice with memory SRP_List("Release", Handle)