Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check which procedure or routine called Access method
Message
 
 
To
02/05/2021 12:51:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01679909
Message ID:
01680107
Views:
29
>>>>>Try PROGRAM() or ASTACKINFO()
>>>>>
>>>>
>>>>Hi Lutz,
>>>>
>>>>Getting back to this thread. You recommended to use ASTACKINFO(). Now I am trying to implement it.
>>>>But I only want to get the last routine that was called before ASTACKINFO(). Does it mean that I would need to access the array element equal to the total number of elements? For example:
>>>>
>>>>ASTACKINFO(aStackArray)
>>>>?  aStackArray[alen(aStackArray,1),1)  && Program
>>>>?  aStackArray[alen(aStackArray,1),2)  && Module
>>>>
>>>>
>>>>Am I on the right track?
>>>>
>>>>TIA
>>>
>>>Hi Dimitry,
>>>
>>>In general, yes.
>>>Depending on your style of programming this approach - but I guess you need the caller of your access_ method, so
>>>
>>>ASTACKINFO(aStackArray)
>>>?  aStackArray[alen(aStackArray,1)-1,1)  && Program
>>>?  aStackArray[alen(aStackArray,1)-1,2)  && Module
>>>
>>>
>>>or, for the lazy ones like me
>>>
>>>LOCAL;
>>> lnLevel
>>>
>>>lnLevel =  ASTACKINFO(aStackArray)-1 &&Level calling your ACCESS_
>>>?  aStackArray[m.lnLevel,1)  && Program 
>>>?  aStackArray[m.lnLevel,2)  && Module
>>>
>>>
>>>HTH
>
>>
>>First, thank you. What I don't understand is why you use -1. That is, why you are not getting the most recent program and module but rather penultimate?
>
>You've gathered the wrong column(s) See example below
>So we do:
>
>
>Clear
>
>blib()
>
>Function blib
>
>	loOb =  Createobject('blablub')
>	loOb.bla()
>Endfunc &&blib
>
>Define Class blablub   As Custom
>
>	Function bla
>		Return This.blub()
>	Endfunc &&bla
>
>	Function blub
>		lnlevel = Astackinfo(lastack)
>		?lastack(lnlevel,3)
>		?lastack(lnlevel-1,3)
>		?lastack(lnlevel-2,3)
>	Endfunc &&blub
>Enddefine &&blablub
>
Yes, you are right. I was getting the wrong columns.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform