read parameters through StackFrame

R

Random

I'm trying to figure out a way to read parameter values from a prior
function call in the StackFrame. I know reflection won't let me do this, it
wasn't designed to do anything but report on static data, but is there
another way?

What I'm looking for is to do something similar to the following...

Public Class MyClass
Inherits MyClassBase

Function GetFoo(arg1 as string, arg2 as string) as Foo
Return MyBase.FindFoo()
End Function
End Class

Public Class MyClassBase
Function FindFoo() As Foo
(this function would need to read the calling function parameter
values to determine what it returns)
(this function would be called by many functions in the inherited
class, which is why I'm not passing the parameters directly)
End Function
End Function

I'm thinking I could pass in a ParamArray, but I'd like to avoid doing that
if possible. I'd like to avoid requiring any effort on the part of a
developer writing new methods in the MyClass class (e.g. "always include
these lines of code in your function...").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top