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> Special Variables$ZREFERENCE cannot be otherwise modified using the SET command. Attempting to doso results in a error.ExamplesThe following example returns the last global reference:SET ^a(1,1)="Hello" ; Full global referenceSET ^(2)=" world!" ; Naked global referenceWRITE $ZREFERENCEreturns:^a(1,2)The following example returns global references from several different commands. Note thatWRITE and ZWRITE set different representations of the same global reference.SET (^barney,^betty,^wilma,^fred)="flintstone"WRITE !,$ZREFERENCEKILL ^fliesWRITE !,$ZREFERENCEWRITE !,^fredWRITE !,$ZREFERENCE,!ZWRITE ^fredWRITE !,$ZREFERENCEreturns:^fred; last of several globals set in left-to-right order^flies; KILL sets global indicator, though no global to killflintstone; WRITE global^fred; global from WRITE^fred="flintstone" ; ZWRITE global^fred(""); global from ZWRITEThe following example stores in $ZREFERENCE the last of several global references followinga ZWRITE command. $ZREFERENCE contains ^Flintstone(2,2). This is the lastglobal reference displayed in the ZWRITE sort order, not the last global referenced prior toZWRITE.SET ^Flintstone(2,1)="Barney"SET ^Flintstone(2,2)="Betty"SET ^Flintstone(1,1)="Fred"SET ^Flintstone(1,2)="Wilma"ZWRITE ^FlintstoneWRITE !,$ZREFERENCEThe following example returns an extended global reference. Note that the namespace nameis always returned in uppercase letters:486 <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!