Performs a REPLACE on an SRP Fast Array.
Syntax
SRP_FastArray("Replace", Handle, Field, Value, SubValue, New)
Parameters
Parameter | Description |
---|---|
Handle | Handle to an existing SRP Fast Array (REQUIRED) |
Field | Field position (REQUIRED) |
Value | Value position (REQUIRED) |
SubValue | SubValue position (REQUIRED) |
New | The new value that replace the given element in the SRP Fast Array (REQUIRED) |
Remarks
The Replace service 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.
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) // All done SRP_FastArray("Release", 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