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> FunctionsSET x=$CHAR(0,0,0,1,16,27,134,240)SET a=$LISTTOSTRING(x,",") // generates a errordelimiterA character (or string of characters) used to delimit substrings within the output 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 can specifya null string ("") as a delimiter; in this case, substrings are concatenated with no delimiter.To specify a quote character as a delimiter, specify the quote character twice ("""") or use$CHAR(34).ExampleThe following example creates a list of four elements, then converts it to a string with theelements delimited by the colon (:) character:SET namelist=$LISTBUILD("Deborah","Noah","Martha","Bowie")WRITE $LISTTOSTRING(namelist,":")returns "Deborah:Noah:Martha:Bowie"See Also• $LISTFROMSTRING function• $LISTBUILD function• $LIST function• $PIECE function• $LISTDATA function• $LISTFIND function• $LISTGET function• $LISTLENGTH function• $LISTNEXT• $LISTSAME function262 <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!