Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

Working With Indices

generated description: personi

Now let's look again at ^PersonI and $Order. In the example, even though ^PersonI can have up to four subscripts, we're traversing the children of the root: the first dimension. $Order returns the first valid subscript, in this case, “DOB”. Passing “DOB” as the subscript in turn returns the next valid subscript, “Name”. Passing “Name” returns “Phone”, and passing “Phone” causes $Order to return the empty string.

When we use $Order to traverse this level, it returns one of each subscript. In the view shown here, “DOB”, “Name”, and “Phone” repeat three times. This isn't an error, it's just the Portal's way of displaying globals. There is only one “DOB” node, one “Name” node, and one “Phone” node in the tree.

SAMPLES>write $order( ^PersonI("") )
SAMPLES>write $order( ^PersonI("DOB") )
SAMPLES>write $order( ^PersonI("Name") )
SAMPLES>write $order( ^PersonI("Phone") )

Copy code to clipboard
FeedbackOpens in a new window