Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to get all defined variables?

Status
Not open for further replies.

DonQuichote

Programmer
Nov 9, 2001
980
For error logging purposes, I want to capture the state of my program. In PHP, there is a function called get_defined_vars(), which returns a list of all the variables visible in the current scope. Is there something like that for VB.NET (2008)?


+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
No, but you could serialize objects when error logging. This requires that you structure your application to capture all pertinent variables when serializing your objects. The cool thing about this approach is that if you structure your application appropriately, you could actually deserialize the same objects based on the error dump and load the same state as was on the machine that had the error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top