Performs a REPLACE on an SRP Fast Array.

Syntax

SRP_FastArray_Replace(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 that replace the given element in the SRP Fast Array (REQUIRED)

Remarks

The SRP_FastArray_Replace method mimics the BASIC+ Replace function and works exactly the same way. Provide a new value via the New parameter and specify the Field, Value, and Subvalue positions you want the new value to replace. To replace a whole field, set Value and SubValue to 0. To replace a whole value, set SubValue to 0.

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

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")

// Replace DEF with XYZ
SRP_FastArray_Replace(Handle, 1, 2, 2, "XYZ")

// Get the final array
Variable = SRP_FastArray_GetVariable(Handle)

Final variable looks like this:

<1>
<1, 1>
<1, 2>
  <1, 2, 1> ABC
  <1, 2, 2> XYZ
<2>         EFG
<3>
<3, 1>
  <3, 1, 1>
  <3, 1, 2>
  <3, 1, 3>
  <3, 1, 4>
  <3, 1, 5>
  <3, 1, 6>
  <3, 1, 7> HIJ
  • No labels