Rep

The Replace function replaces a field, subfield, or sub-subfield in a dynamic array.

Group     Dynamic Array Group

Syntax StringData = vRep(vStringData, vFLD, [vSUB], [vSSUB], vSTR)

vStringData (Variant) is the dynamic array string variable name

vFLD          (Variant) is the array field number to search.

vSUB          (Variant) Optional – is the array subfield number.

vSSUB       (Variant) Optional – is the array sub-subfield number.

vSTR          (Variant) is data or variable name, which will be inserted at the dynamic array location (vFLD, vSUB, vSSUB).

Example

Given : "John#31#Canadian English@UnitedKingdom English&Mike"

StringData = Rep(StringData, 2, "Albert")  ' removes Mike and returns:

"John#31#Canadian English@UnitedKingdom English&Albert"

StringData = Rep(StringData, 1, "Fred")  ' removes whole first record and returns: "Fred&Albert"

Using subfields, given:

 "John#31#Canadian English@UnitedKingdom English&Mike"

StringData = Rep(StringData, 1, 2,  "80")  ' using the first record and the second subfield, 31 is replaced with 80 giving:

"John#80#Canadian English@UnitedKingdom English&Mike"

StringData = Rep(StringData, 1, 3, 2, "US English")  ' using the first record, the third subfield and the second sub subfield, United Kingdom English is replaces with US English giving:

"John#80#Canadian English@US English&Mike"