contents.gifindex.gifprev1.gifnext1.gif

Cust_Rcrd_Pattern_Content

Purpose

Returns one or more patterns found within a target expression string. This function is similar to Pattern_Content(), but it gets its Pattern(s) and Return_Mask(s) from the Custom Records table.

Arguments

Cust_Rcrd_Pattern_Content(

<RecType>
// A valid Custom Record Record Type which contains Patterns (%T001) and Return_Masks (%T002) to be searched for.
, <Target>
//Where to look .
, <MaxHits>
//The Maximum number of hits that the function may return.
, <Delims>
//One or two characters which serve as delimiters in the result.
)

Example

Assume CUST_RCRD contains the following:

RCRD_CLASS
RCRD_KEY
%T001
%T002
Example
Ptrn 1
####
xxxx
Example
Ptrn 2
#####
xxxxx

Cust_Rcrd_Pattern_Content( "Example"
, "1234 xyz 56789"
, 1, "," )
returns: "1234"

Cust_Rcrd_Pattern_Content( "Example"
, "1234 xyz 56789"
, 9, "," )
returns: "1234,56789,"

Cust_Rcrd_Pattern_Content( "Example"
, "1234 xyz 56789"
, 9 , "()" )
returns: "(1234)(56789)"

Cust_Rcrd_Pattern_Content( "Example"
, "1234 xyz 56789"
, 9 , ".." )
returns: ".1234.56789."

Cust_Rcrd_Pattern_Content( "Example"
, "1234 xyz 567890"
, 9 , ".." )
returns: ".1234."

Cust_Rcrd_Pattern_Content( "Example"
, "1234,5678 9012"
, 9 , "[]" )
returns: "[1234][5678][9012]"

Notes

The search is "Rows First". That is, each pattern is tried in turn (in RCRD_KEY order) against the entire string before the remainder of each string attempted.

The search stops when <MaxHits> is reached, or nothing is left to search.

Cust_Rcrd_Pattern_Content(

"Example"

, "1234 4321 56789"

, 9 , "[]" )

Returns: "[1234][56789][4321]"

Note that the 56789 is returned before the 4321. This is because this is a Breadth First and not Depth First search.

Up to <MaxHits> results are returned, delimited by <Delims>. If <MaxHits>=1, then no delimiters are used. If <Delims> is a single character, then that character is used as a trailing delimiter. If <Delims> is a pair of characters, then they are used as Left and Right delimiters respectively. If <Delims> is a pair of characters which are the same, then only a single occurrence of the character appears between each item in the result.