by Gazoot
A flexible datum for dumping debug information. It handles pretty much everything, from integers to savefiles. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Gazoot.var_dump##version=13

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:


Version 13
Date added: Mar 12 2005
Last updated: Jul 29 2009
1 fan
var_dump is a neat debug datum, ported from the PHP function with the same name. It dumps information about any variable in a nice readable format. Debugging stuff gets a lot easier with this library! For example, doing this:
var/list/L = list("name" = "Gazoot", "id" = 12345)
Results in this:

  'name' = "Gazoot"
  'id' = 12345

Version history

Version 13
* Added a var, "deep_list_length" to the var_dump datum, which forces brief output of
datums in a list longer than that length.

Version 12
* Removed the brief datum. It is better to specify it as an argument in New() instead.
* Rewrote the output functions for better handling of text.
* Fixed some depth var bugs.

Version 11
* XHTML broke the output window display. There is now a var_dump/xhtml datum which should be
used when output should be to the browser. For normal window output, use var_dump/html.
* Updated the predefined procs to use the new xhtml datum.
* Updated the demo to include XHTML as well.

Version 10
* Html output is now valid XHTML 1.0 strict.
* Fixed a typo in documentation.

Version 9
* Upgraded/modified documentation a bit.
* Refactored the code for easier implementation of other output formats.
* When dumping a client, it now says "client" instead of "datum".

Version 8
* Documented!

Version 7
* Savefile dump now available!
* Added savefile test and lots of other stuff to the demo.
* "brief" var added, to display no information about datums, just their name, type and reference.
It can be enabled in the var_dump constructor.
* Added a brief datum to html and text output, for auto-enabling the brief var.
(/var_dump/html/brief for example)
* Sorry, documentation has to wait until v.8. But now it's about the only thing to add.

Version 6
* Fixed a small bug in _datum() output.
* The documentation have to wait until v.7. But hopefully that version will have savefile dumping as well.

Version 5
* Added many kinds of dumper datums (Thanks to YMIHere for the suggestion).
Until documentation is finished (v.6), look at the procs below to see how they work.

Version 4
* Improved the demo a bit more.
* Moved everything into its own datum, "var_dumper".
* Reflist is now used for all objects in browser mode, not only for each argument to var_dump().
* Now all already referenced objects are linked to the original object.
* Changed the display for associated lists from "=>" to "=", to be more similar to Byonds format.
* Renamed "shallow" to "depth", to control how many levels to dump.

Version 3
* Added color for procs and verbs.
* Every datum is now displayed with a reference.
* browser_dump() and browser_dump_s() can now be used to display output in the browser window!
The advantage is that the object references are hyperlinked to the original object.
The first mob logging into the world will be the target for the browser output.
(Just remember to add . = ..() if you're overriding mob/Login().)

Version 2
* /client can now be dumped.
* mob.verbs is now working.
* Improved the demo.