Locates a value in an SRP List.
Syntax
Index = SRP_List("Locate", Handle, Target) |
The index of the first element that matches the target value.
Parameter | Description |
---|---|
Handle | Handle to an existing SRP List (REQUIRED) |
Target | The value to locate in the SRP List (REQUIRED) |
The Locate service finds the first element that matches the given target and returns its index. If no match is found, it returns zero. This method is extremely fast because the SRP List is indexed! Instant locates makes searching a huge list lightning fast! Note that Locate is case sensitive. If you want to search in a case insensitive manner, use the Match service.
// Create the list Handle = SRP_List("Create", "ABC,DEF,EFG", ",") // Look for 'DEF', which will return '2' Index = SRP_List("Locate", Handle, "DEF") // Look for 'XYZ', which will return '0' Index = SRP_List("Locate", Handle, "XYZ") // Play nice with memory SRP_List("Release", Handle) |