Indirection is one of the really cool features of Cache Object Script.

Try this:

1. Simple indirection

>s global="^someglobal"

>w @global

This is the same as 'w ^someglobal"

2. Name indirection with $Q

>s global="^someglobal"

>f  s global=$Q(@global) q:global=""  w !,global,"=",@global

This will dump all of the data in ^someglobal, regardless of the number of subscripts.

3. Subscript indirection

>s global="^someglobal"

>s sub="

>f  s sub=$o(@global@(sub)) q:sub=""  w !,sub

This dumps the 1st level subscript values.

---

Search for "Indirection" in your Cache Documentation.  There is lots more...

Have fun,

DaveM