Skip to content

Instantly share code, notes, and snippets.

@mhulse
Created October 2, 2014 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhulse/6f8e26da8c2cc3e69f31 to your computer and use it in GitHub Desktop.
Save mhulse/6f8e26da8c2cc3e69f31 to your computer and use it in GitHub Desktop.
Caché 2009.1 - NEWSCYCLE Solutions: DTI Lighting 7.7.x: Argumentless zwrite, useful when developing code for debug purposes.
<script language="cache" runat="server">
//--------------------------------------------------------------------------
//
// Debug:
//
//--------------------------------------------------------------------------
write !, "<pre>"
try {
set currIO = ##class(%SYS.NLS.Device).SetIO("HTML")
zwrite
}
catch {
write "ERROR: ", $ZERROR
}
if $get(currIO) '= "" {
do ##class(%SYS.NLS.Device).SetIO(currIO)
}
write "</pre>"
</script>
@mhulse
Copy link
Author

mhulse commented Oct 2, 2014

This code uses an argumentless zwrite:

  • Process-private globals are not displayed.
  • Variables are listed by name in ASCII order.
  • Subscripted variables are listed in subscript tree order.

Put above code at bottom of test page to see it in action.

Shameless plug: Here's some test code (tag/RULE) I wrote to super-charge the use of zwrite on the template level. Unfortunately, after I got done developing this code, I found that DTI template system stopped it from working due to how the template system uses includes under the hood. Oh well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment