Question
· Feb 15, 2023

What is "~pointer" in globals, is there a way to see what is behind ?

Out of curiosity, I was looking in ^ROUTINE global to see how routines are stored internally.

I found out that lot of nodes are displaying "~pointer" as associated value (eg: instead of a string).

What are those pointers ? My guess is that it references some cache internal structure (eg: some nodes inside a B-Tree).

Is there a easily way to see what is behind ? Are pointers useful for user globals or is this something purely internal to Cache database ?

Product version: IRIS 2021.1
$ZV: IRIS for Windows (x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:39:22 EDT
Discussion (1)1
Log in or sign up to continue

This means there is no defined data node at this level, but there are subnodes defined. ( Where $Data == 10 )

Remove the ending bracket ")" in Global Explorer the page will display the subnodes. ie: "^ROUTINE("

To see all first keys in Global Explorer: ^ROUTINE()

Or with a comma display all first and second subkeys eg: ^Routine( , )

To see the line count for each Routine: ^ROUTINE( , , 0)

$Data helps programmatically test for a global reference:

0 == Global is not defined

1 == Is a data node only

10 == Has no Data, but has subnodes (~pointer)

11 == Both is a data node AND has subnodes

If unsure of how many subkeys a global might have, can use $Query to generically walk a sparse structure beginning to end.

An example using $Query: A one liner to walk every global node in ROUTINE, looking at each line for the word "test", case insensitive, and print both the global node location and content of the code to the terminal:

s a="^ROUTINE",find="test",q=$Q(@a@("")) f{s q=$Q(@q) q:q=""  s v=$ZCVT(@q,"L")  w:v[find !,q,!,"::",@q}

Hope this helps.