Xojo Conferences

« MBS FileMaker Plugin,… | Home | MBS FileMaker Plugin … »

Tip of the day: Calling function name

Just talked today about how to know the calling function name. Solution can be to ask this by getting call stack. So here a code snippet:
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
The name is encoded name including parameter hints for the compiler.
25 09 16 - 21:18