Adds an element to the end of an SRP List.
Syntax
NewIndex = SRP_List_Add(Handle, Element)
Returns
The index of the newly added element.
Parameters
Parameter | Description |
---|---|
Handle | Handle to an existing SRP List (REQUIRED) |
Element | The new value to add to the end of the list (REQUIRED) |
Remarks
The SRP_List_Add method appends an element to the end of the list and returns that element's index position.
IMPORTANT: You should always release the handle to an SRP List when you no longer need it by calling SRP_List_Release.
Examples
// Create the list Handle = SRP_List_Create() // Add elements Index = SRP_List_Add(Handle, "ABC") Index = SRP_List_Add(Handle, "DEF") Index = SRP_List_Add(Handle, "EFG") // Convert the SRP List into a normal list List = SRP_List_GetVariable(Handle, @FM) // List = "ABC":@FM:"DEF":@FM:"EFG" // Index = 3 // Play nice with memory SRP_List_Release(Handle)