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.

Structured System Variables^$GLOBAL as an argument to $ORDER returns the next or previous global name in collatingsequence to the global name you specify. If no such global name node exists in ^$GLOBAL,$ORDER returns a null string.The direction argument specifies whether to return the next or the previous global name. Ifyou do not provide a direction argument, <strong>Caché</strong> returns the next global name in collatingsequence to the one you specify. For further details, refer to the $ORDER function.The following subroutine searches the user's default namespace and stores the global namesin a local array named GLOBAL.GLOBSET NAME=""WRITE !,"The following globals are in ",$ZNSPACEFOR I=1:1 {SET NAME=$ORDER(^$GLOBAL(NAME))WRITE !,NAMEQUIT:NAME=""SET GLOBAL(I)=NAME}WRITE !,"All done"QUITAs an Argument to $QUERY^$GLOBAL as an argument to $QUERY returns the next global name in collating sequenceto the global name you specify. If no such global name exists as a node in ^$GLOBAL,$QUERY returns a null string.In the following example, three globals (^GBL1, ^GBL2 and ^GBL3) are present in theSAMPLES namespace.ZNSPACE "SAMPLES"SET (^GBL1,^GBL2,^GBL3)="TEST"ZNSPACE "USER"WRITE $QUERY(^$|"SAMPLES"|GLOBAL("^GBL1"))WRITE !,$QUERY(^$|"SAMPLES"|GLOBAL("^GBL2"))ZNSPACE "SAMPLES"KILL ^GBL1,^GBL2,^GBL3The first WRITE returns ^$|"SAMPLES"|GLOBAL("^GBL2")The second WRITE returns ^$|"SAMPLES"|GLOBAL("^GBL3")See Also• $DATA function• $ORDER function• $QUERY function504 <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!