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 VariablesXECUTE "ZREMOVE"XECUTE "ZSAVE ROU"WRITE !,$DATA(^$ROUTINE("^ROU"))XECUTE "ZSAVE ROU"WRITE !,$DATA(^$ROUTINE("^ROU"))As an Argument to $ORDER$ORDER(^$|nspace|ROUTINE( routine_name),direction)^$ROUTINE as an argument to $ORDER returns the next or previous routine name incollating sequence to the routine name you specify. If no such routine name exists as a nodein ^$ROUTINE, $ORDER returns a null string.The direction argument specifies whether to return the next or the previous routine name. Ifyou do not provide a direction argument, <strong>Caché</strong> returns the next routine name in collatingsequence to the one you specify. For further details, refer to the $ORDER function.The following subroutine searches the USER namespace and stores the routine names in alocal array named ROUTINE.SET rname=""FOR I=1:1 {SET rname=$ORDER(^$|"USER"|ROUTINE(rname))QUIT:rname=""SET ROUTINE(I)=rnameWRITE !,"Routine name: ",rname}WRITE !,"All routines stored"QUITAs an Argument to $QUERY$QUERY(^$|nspace|ROUTINE(routine_name))^$ROUTINE as an argument to $QUERY returns the next routine name in collating sequenceto the routine name you specify. The specified routine name does not have to exist. If thereis no routine name later in the collating sequence, $QUERY(^$ROUTINE) returns a nullstring.In the following example, two $QUERY functions return the next routine after the specifiedroutine name in the USER namespace.SET rname=""WRITE !,"1st routine: ",$QUERY(^$|"USER"|ROUTINE(rname))SET rname="%m"WRITE !,"1st ",rname, " routine: ",$QUERY(^$|"USER"|ROUTINE(rname))QUITSee Also• $DATA function512 <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!