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$LISTNEXT and Nested ListsThe following example returns three elements, because $LISTNEXT does not recognize theindividual elements in nested lists:SET list=$LISTBUILD("Apple","Pear",$LISTBUILD("Walnut","Pecan"))SET ptr=0,count=0WHILE $LISTNEXT(list,ptr,value) {SET count=count+1WRITE !,value }WRITE !,"End of list: ",count," elements found"QUITSee Also• $LIST function• $LISTBUILD function• $LISTDATA function• $LISTFIND function• $LISTFROMSTRING function• $LISTGET function• $LISTLENGTH function• $LISTSAME function• $LISTTOSTRING$LISTSAMECompares two lists and returns a boolean value.$LISTSAME(list1,list2)$LS(list1,list2)Parameterslist1list2Any expression that evaluates to a list.258 <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!