RField

The RField function searches a string from the right to extract a sub-string by using a specified delimiter character.

Group: Dynamic Array Extensions


Syntax: vVAL= RField(vStringData, vDelimiter, vStartField, [vNumberFields])

vVAL               (Variant) is the resulting sub-string value located in StringData

vStringData     (Variant) is a string or string variable to be searched

vDelimiter        (Variant) is a specified delimiter character

vStartField       (Variant) is the Delimiter to start from when searching the StringData

vNumberFields (Variant) Optional – specifies the number of sub-fields to retrieve.

Example:

If VAR = "111|222|333", then:

VAL = RField(VAR, "|", 1) returns VAL = '333'

VAL = RField(VAR, "|", 3) returns VAL = '111'

Note: If StartField = 1, then the RField function will return a sub-string which starts at the end of VAR, up to the first occurrence of Delimiter.