Versions Compared

Key

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

...

MethodDescription
CountCounts the number of fields, values, or subvalues in an SRP Fast Array.
CreateCreates a new SRP Fast Array.
DeletePerforms a DELETE on an SRP Fast Array.
ExtractPerforms an EXTRACT on an SRP Fast Array.
GetVariableConverts an SRP Fast Array back into a BASIC+ dynamic array.
InsertPerforms an INSERT on an SRP Fast Array.
InsertFromListInserts an SRP List into an SRP Fast Array.
MatchFinds the first element to match a given string.
ReduceCreates a new fast array containing only those elements that match the given string.
ReleaseReleases the handle to an SRP Fast Array.
ReplacePerforms a REPLACE on an SRP Fast Array.
ReplaceWithListReplaces an element in an SRP Fast Array with an SRP List.

...

SRP_FastArray does not have built in searchinga Locate service, but SRP List does. Thankfully, SRP Lists can be created instantaneously from SRP Fast Arrays using a special method. So, we can do a locate at blinding speeds after all:it does have the Match and Reduce services. The Match service looks for an element that matches (in part or in total) a given string and gives you the position of the first match. The Reduce service finds all elements that match a string and return a reduced array containing only those elements.

Code Block
Pos
Code Block
ListHandle = SRP_List_CreateFromFastArray(ArrayHandleFastArray("Match", Handle, 2Target, 10)
Pos = SRP_List_Locate(ListHandle, Target)
SRP_List_Release(ListHandleFieldPos, ValuePos, SubValuePos, "MatchAll")

Inserting SRP Lists

SRP Fast Arrays play nicely with SRP Lists. In addition to using Insert and Replace on single values, you can also insert SRP whole SRP Lists or replace elements with whole SRP Lists. Since SRP Lists have no delimiter recognitions at all, they will behave as though they are delimited one level lower than the insert level. So, if you insert an SRP List into a field position, the SRP List will behave as though it is value-mark delimited.

...