LocateDel
The LocateDel function will remove a value from the dynamic array and report the location in the list where it was. If the value does not exist, 0 is returned. This function does not interact with SUB and SSUB fields and therefore treats a whole record with subfields as 1 string during the compare.
Group: Dynamic Array Extensions
Syntax: vNbr = LocateDel(vVAL, vInfo, [vDLM]).
vNbr (Variant) the position in the dynamic array where the VAL was found and deleted.
vVAL (Variant) the value to be located and deleted from the Dynamic Array.
vInfo (Variant) is the dynamic array variable that will be searched.
vDLM (Variant) Optional – is the delimiter to use when searching.
Example:
Dim Nbr As Integer
Dim sNames As String
sNames = "John#31#Canadian English@UnitedKingdom English&Mike"
Nbr = LocateDel("Mike", sNames) ' Nbr = 2, the second record
Nbr = LocateDel("31", sNames, Chr(2))
Nbr = 2, since the age is a subfield specifying the Chr(2) delimiter finds “31” in the second position of the first record.