Performs an INSERT on an SRP Fast Array.

Syntax

SRP_FastArray("Insert", Handle, Field, Value, SubValue, New)

Parameters

ParameterDescription
HandleHandle to an existing SRP Fast Array (REQUIRED)
FieldField position (REQUIRED)
ValueValue position (REQUIRED)
SubValueSubValue position (REQUIRED)
NewThe new value being inserted into the SRP Fast Array (REQUIRED)

Remarks

The Insert service mimics the BASIC+ Insert function and works exactly the same way. Provide the new value you want to insert and pass the Field, Value, and SubValue positions. To insert a field, set Value and SubValue to 0. To insert a value, set SubValue to 0. You can also use -1 to append the new value to the end of the given position(s).

Examples

// Create an empty fast array
Handle = SRP_FastArray("Create")

// Insert several values
SRP_FastArray("Insert", Handle, 1, 2, 0, "ABC":@SVM:"DEF")
SRP_FastArray("Insert", Handle, 2, 0, 0, "EFG")
SRP_FastArray("Insert", Handle, 3, 1, 7, "HIJ")
 
// Convert back into a BASIC+ array
Array = SRP_FastArray("GetVariable", Handle)
 
// All done
SRP_FastArray("Release", Handle)

The final variable looks like this:

<1>
<1, 1>
<1, 2>
  <1, 2, 1> ABC
  <1, 2, 2> DEF
<2>         EFG
<3>
<3, 1>
  <3, 1, 1>
  <3, 1, 2>
  <3, 1, 3>
  <3, 1, 4>
  <3, 1, 5>
  <3, 1, 6>
  • No labels