read parameters through StackFrame

Discussion in 'ASP .Net' started by Random, Aug 13, 2007.

  1. Random

    Random Guest

    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...").
     
    Random, Aug 13, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Fidge
    Replies:
    0
    Views:
    1,144
    Ben Fidge
    Jan 15, 2005
  2. Joe Rattz
    Replies:
    3
    Views:
    442
    Scott Allen
    Jun 15, 2005
  3. Jonck van der Kogel
    Replies:
    2
    Views:
    998
    Jonck van der Kogel
    May 27, 2004
  4. Ken.C
    Replies:
    1
    Views:
    567
    Chris Uppal
    Feb 7, 2007
  5. Jason
    Replies:
    2
    Views:
    525
    Jonathan Mcdougall
    May 13, 2006
Loading...

Share This Page