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> Functionsof delimiter characters added is equal to the from value, minus the number of existingdelimiters, minus one:SET smallcolor="Green;Blue"WRITE !,smallcolorSET $PIECE(smallcolor,";",4)="Red"WRITE !,smallcolorThe following example initializes newvar to the character pattern ">>>>>>TOTAL":SET newvar=""SET $PIECE(newvar,">",7)="TOTAL"WRITE newvarSee the "SET with $PIECE and $EXTRACT" section of the SET command documentationfor more information.$PIECE with Parameters over 32,768 CharactersThe following example creates a string of 5 periods and a null:SET x="",$PIECE(x,".",6)=""WRITE xNow consider the following example that creates a string of 32767 periods and a null:SET x="",$PIECE(x,".",32768)=""Although technically within the maximum length of a string, this example generates a error. Do not use a parameter with $PIECE greater than 32767.See Also• $EXTRACT function• $LENGTH function• $LIST function• $LISTBUILD function• SET command286 <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!