MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to know the calling function?
Feedback.

Answer: On Mac you can use a helper function like this this code:
Example:
Public Function CallingFunction() as string
// Query name of calling function of a function

#Pragma BreakOnExceptions false

try

// raise a dummy exception
dim r as new NilObjectException
raise r

catch x as NilObjectException

// get stack
dim stack() as string = x.Stack

// pick function name and return
dim name as string = stack(2)
Return name

end try
End Function
Notes: You need to include function names in your application.




Links
MBS Xojo Plugins