Im building an error routine that will give me the variable names and the values in the faulty sub or function.
Calling Code:
PrmArgument returns the variable name, not the value. How do i get the value or is there a better way to do this?
Thanks
VB.NET:
Public Class myParamInfo
public paramName as string
public paramValue as String
paramType as string
End Class
Calling Code:
VB.NET:
Dim stFrame As New StackFrame
Dim currentMethod As System.Reflection.MethodBase = stFrame.GetMethod()
Dim currentParameters() As System.Reflection.ParameterInfo = currentMethod.GetParameters()
Dim prmArgument As ParameterInfo
dim argList as New ArrayList
Try
stuff
catch ex as exception
For each prmArgument in currentParameters
dim oparaminfo as New myParamInfo
oparaminfo.paramName = prmArgument.name
oParaminfo.paramValue = ?
oParamInfo.paramtype= prmArgument.ParameterType.tostring
arrgList.add(oParamINfo)
Next prmArgument
DoCustomErrorStuff(argList)
End Try
PrmArgument returns the variable name, not the value. How do i get the value or is there a better way to do this?
Thanks