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.

ParametersplistThe target string from which the substring is to be returned. It can be a string literal, a variablename, or any valid <strong>Caché</strong> <strong>ObjectScript</strong> expression that evaluates to a string. If you specify anull string ("") as the target string, $PIECE returns the null string.A target string usually contains instances of a character (or character string) which are usedas delimiters. This character or string cannot also be used as a data value within plist.When $PIECE is used with SET on the left hand side of the equals sign, plist must evaluateto a valid variable name.delimiterThe search string to be used to delimit substrings within plist. It can be a numeric or stringliteral (enclosed in quotation marks), the name of a variable, or an expression that evaluatesto a string.Commonly, a delimiter is a designated character which is never used within string data, butis set aside solely for use as a delimiter separating substrings. A delimiter can also be a multicharactersearch string, the individual characters of which can be used within string data.If you specify a null string ("") as the delimiter, $PIECE returns the null string.from$PIECEThe number of a substring within plist, counting from 1. It must be a positive integer, thename of an integer variable, or an expression that evaluates to a positive integer. Substringsare separated by delimiters.• If the from parameter is omitted or set to 1, $PIECE returns the first substring of plist.If plist does not contain the specified delimiter, a from value of 1 returns plist.• If the from parameter identifies by count the last substring in plist, this substring isreturned, regardless of whether it is followed by a delimiter.• If the value of from is the null string (""), zero, a negative number, or greater than thenumber of substrings in plist, $PIECE returns a null string.If the from parameter is used with the to parameter, it identifies the start of a range of substringsto be returned as a string, and should be less than the value of to.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 281

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

Saved successfully!

Ooh no, something went wrong!