11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> Functionsa list can contain all possible characters, and is ideally suited for bit-string data. Lists arehandled using the <strong>Caché</strong> <strong>ObjectScript</strong> $LIST functions.ParametersstringA string literal (enclosed in quotation marks), a numeric, or a variable or expression thatevaluates to a string. This string can contain one or more substrings (elements), separated bya delimiter. The string data elements must not contain the delimiter character (or string),because the delimiter character is not included in the output list.delimiterA character (or string of characters) used to delimit substrings within the input string. It canbe a numeric or string literal (enclosed in quotation marks), the name of a variable, or anexpression that evaluates to 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 multicharacterstring, the individual characters of which can be used within string data.If you specify no delimiter, the default delimiter is the comma (,) character. You cannotspecify a null string ("") as a delimiter; attempting to do so results in a error.ExampleThe following example takes a string of names which are separated by a blank space, andcreates a list:SET namestring="Deborah Noah Martha Bowie"SET namelist=$LISTFROMSTRING(namestring," ")WRITE !,"1st element: ",$LIST(namelist,1)WRITE !,"2nd element: ",$LIST(namelist,2)WRITE !,"3rd element: ",$LIST(namelist,3)See Also• $LISTTOSTRING function• $LISTBUILD function• $LIST function• $PIECE function• $LISTDATA function252 <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!