Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The SRP_List_InsertAt method inserts a value into an SRP List at the given position. Unlike the OI Insert method, passing an index of -1 will _not_ add the element to the end of the array. To perform an add, you need to SRP_List_Add. The reason is speed. In all other ways, however, the SRP_List_InsertAt method works just like the OI Insert function.

IMPORTANT: You should always release the handle to an SRP List when you no longer need it by calling SRP_List_Release.

Examples

 

Code Block
// Create the list
Handle = SRP_List_Create()

// Insert several elements
SRP_List_InsertAt(Handle, 1, "ABC")
SRP_List_InsertAt(Handle, 10, "DEF")
SRP_List_InsertAt(Handle, 5, "EFG")

// Convert the SRP List into a normal list
List = SRP_List_GetVariable(Handle, ",")

// List = "ABC,,,,EFG,,,,,DEF"

// Play nice with memory
SRP_List_Release(Handle)