Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which procedure called?
Message
 
To
10/11/2016 09:09:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01643048
Message ID:
01643064
Views:
46
>>>>>Hi,
>>>>>
>>>>>I forgot how or if it is possible to know which procedure called? For example, at run-time I want to write into a hidden log which procedure called this method/procedure?
>>>>>
>>>>>TIA
>>>>
>>>>PROGRAM()?
>>>
>>>Thank you. I think this is what I used before. Do I understand that I can assume 3 levels and do something like this:
>>>PROGRAM(1)
>>>PROGRAM(2)
>>>PROGRAM(3)
>>>?
>>
>>Sure.
>
>Is it possible that I am not getting result I expect because I run the app from the VFP IDE?
>
>Here is what I did for testing: I call method METHOD1 from method METHOD2. Then in METHOD1 I log Program(0) and Program(1) but they return the name of the Application file. And Program(2) returns the START call. I was hoping to see the name of METHOD2 in METHOD1 but I don't see it.
>What am I missing?


That works for me:
CLEAR
oTest = CREATEOBJECT("TestMe")

oTest.Test1()


DEFINE CLASS TestMe AS Custom

FUNCTION Test1()
? "Test1", PROGRAM(1)
? "Test1", PROGRAM(2)
? "Test1", PROGRAM(3)
?
this.Test2()
RETURN


FUNCTION Test2()
? "Test2", PROGRAM(1)
? "Test2", PROGRAM(2)
? "Test2", PROGRAM(3)
?
this.Test3()
RETURN

FUNCTION Test3()
? "Test3", PROGRAM(1)
? "Test3", PROGRAM(2)
? "Test3", PROGRAM(3)
RETURN
ENDDEFINE
BTW Greg is right ASTACKINFO return more information than just PROGRAM()
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform