Value2ConstantDebug is a tiny little include which makes your debuging lifes easier. As soon as you're dealing with issues in event-handling you'll find out that those anonymous numbers and values are unnecessarily complicating everything and hindering your progress.
That's where/when Value2ConstantDebug comes in handy. It takes a value (f.i. of an event) and converts it back to the according constant-name.
Furthermore Value2ConstantDebug adds a smart feature as suppression of redundant values.
How to use it? Well, it's just like an enhanced Debug statement. Take a look at this example:
v2cd_Debug(EventType(), "#pb_eventtype_,#pb_anti", #True, #True)
According to the procedure's (v2cd_Debug) declaration ...
v2cd_Debug(value.i, constantNameFilter.s = "", suppressRedundancies.b = #True, printIfNotFound.b = #True)
... this would re-convert the EventType()-returnvalue to a (all) constant-name(s) starting with "#pb_eventtype_" or "#pb_anti".
Furthermore any redundancies would be suppressed, though counted and printed as one message when the value changes.
If no fitting constant-definition is found the value still gets printed in its original form.
Why the argument "constantNameFilter"?
Well, there are some specific values that are shared through lots of constants (names). So which would be the fitting one? The easy answer is "only YOU can", and therefore you're helping yourself by filtering out the right ones by defining the contant-name beginnings you'd like to get.
An empty "constantNameFilter" brings up only the original values, though the redundancy suppression feature still can be used.
Setting "constantNameFilter" to "#" will bring you *all* known constant-names for the according value - these might be many.
However, I was once fed up with dealing with event-issues and so I coded this tiny tool. I hope that it will also be useful to you guys.Download
EDIT: This should work on Linux and Mac OS, too - but I didn't test it on the latter, yet.