For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > March 2004 > Find out where the function was called from









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Find out where the function was called from
Faraz Azhar

2004-03-30, 3:30 am

Hello,

Is there any way to find out where a function is called from? For eg..
this is a function called cTemp in a module. It can be called from
numerous forms. Can the function cTemp find out from which form it is
called from or if not form, can it find out from which sub/function it
was called from?

Can this be done ?

- Faraz Azhar
Rick Rothstein

2004-03-30, 4:32 am

> Is there any way to find out where a function is called from? For eg..
> this is a function called cTemp in a module. It can be called from
> numerous forms. Can the function cTemp find out from which form it is
> called from or if not form, can it find out from which sub/function it
> was called from?
>
> Can this be done ?


If I understand what you are doing correctly, you should be able to find out
which form called cTemp by examining the Screen.ActiveForm object. The
form's name is

Screen.ActiveForm.Name

You should be able to get to any property of the calling form by using this
object.

Rick - MVP


Faraz Azhar

2004-03-30, 12:30 pm

hmm.. that would be a good tricky way. so i understand there is not
any 'actual' method of knowing this.. only work-arounds.. ok. :) thnx!
Don@home.com

2004-03-30, 12:30 pm

On 30 Mar 2004 08:20:53 -0800, itz_faraz@hotmail.com (Faraz Azhar) wrote:

>hmm.. that would be a good tricky way. so i understand there is not
>any 'actual' method of knowing this.. only work-arounds.. ok. :) thnx!


IMOHO: Actual = Work-Arounds = Actual = etc... LOL...
Just like NoBody writes a NEW Program...
All they are doing is creating the latest modification of the modifications...
ie: First character typed = New and after that everything is a modification...
<g>

Have a good day...

Don
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com