11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Caché</strong> <strong>ObjectScript</strong> Functions$PIECEReturns the specified substring, based on a delimiter.$PIECE(plist,delimiter,from,to)$P(plist,delimiter,from,to)ParametersplistdelimiterfromtoThe target string from which a substring is to be returned.A delimiter used to identify substrings.Optional — An integer that specifies the substring, or beginning of arange of substrings, to return from the target string. Substrings areseparated by a delimiter, and counted from 1. If omitted, the firstsubstring is returned.Optional — An integer that specifies the ending substring for a rangeof substrings to return from the target string. Must be used with from.Description$PIECE returns the specified substring (piece) from plist. The substring returned dependson the parameters used:• $PIECE(plist,delimiter) returns the first substring in plist. If delimiter occurs in plist,this is the substring that precedes the first occurrence of delimiter. If delimiter does notoccur in plist, the returned substring is plist.• $PIECE(plist,delimiter,from) returns the substring which is the nth piece of plist, wherethe integer n is specified by the from parameter, and pieces are separated by a delimiter.The delimiter is not returned.• $PIECE(plist,delimiter,from,to) returns a range of substrings including the substringspecified in from through the substring specified in to. This four-argument form of$PIECE returns a string that includes any intermediate occurrences of delimiter thatoccur between the from and to substrings. If to is greater than the number of substrings,the returned substring includes all substrings to the end of the plist string.280 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!