Alexander Neuber · Jul 26, 2023 go to post

Hi, look at ^$GLOBAL

GLOB   
  SET NAME=""
  WRITE !,"The following globals are in ",$NAMESPACE
  FOR I=1:1 {
    SET NAME=$ORDER(^$GLOBAL(NAME))
    WRITE !,NAME
    QUIT:NAME=""
    SET GLOBAL(I)=NAME
  }
  WRITE !,"All done"
  QUIT

I hope it is what you need