Skip to content

Instantly share code, notes, and snippets.

@ztmr
Created January 23, 2013 11:38
Show Gist options
  • Save ztmr/4604633 to your computer and use it in GitHub Desktop.
Save ztmr/4604633 to your computer and use it in GitHub Desktop.
Quick'n'dirty tailored version of GT.M's GDE utility. Useful for getting database parameters dynamically at runtime.
GDEINFO
i $$set^%LCLCOL(0)
s (debug,runtime)=0
s io=$io,useio="io",comlevel=0,combase=$zl,resume(0)=$zl_":INTERACT"
i $$set^%PATCODE("M")
d GDEINIT^GDEINIT,GDEMSGIN^GDEMSGIN,GDFIND^GDESETGD,CREATE^GDEGET:create,LOAD^GDEGET:'create
w " *** List of regions and their configuration *** ",!
n rid,parId s rid="" f s rid=$o(regs(rid)) q:rid="" d
. w !," Region: "_rid,!
. s parId="" f s parId=$o(regs(rid,parId)) q:parId="" d
. . w " "_parId_" = "_regs(rid,parId)
. . s max=$g(maxreg(parId))
. . w $s(max'="":" (max: "_max_")",1:""),!
q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment