Link to home
Start Free TrialLog in
Avatar of cwi2k
cwi2k

asked on

getting assigned variables

hi i am trying to show what variables are assigned in a sub

i want to output them and use them for debugging

cheers
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

I am not sure I am following you can you clarify this a bit ? perhaps a small code example showing what you are intrested in.

Greg
Avatar of amyhxu
amyhxu

You can use Console.WriteLine(VariableName.ToString()) to write to Output console after the code that assigns new value to "VariableName".
Not sure if this is what you asked for.
Avatar of cwi2k

ASKER

hi i am trying to get a list of all the variables that are declared without having to know what they are called so if the program crashes i can print out what data was in the variables

cheers
the only way to do this would be to use the debugging interface and would be ALOT of code ... I do not recommend trying.
Hi,
have you tried using the locals & watch windows?

In VS.NET, go to Debug (from main menu), --> Watch, or --> Locals (while your app is running)

Locals will show you all the variables that are in scope and what their current value is.
Watch window allows you to watch a particular variable's value.

HTH
David
Avatar of cwi2k

ASKER

hi i am trying to do it once i have released the program on a pc that doesnt have .net
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial