Returning the name of a caller function?
josh.liptonduffin
Hi all,
I'm sure there is a way to do this (perhaps with FunctionInfo), but I cannot figure it out yet. I would like to determine the name of a function that calls another function.
Example code below: if call "foo()" I should see "foo" printed to the history window, and if I call "bar()" I should see "bar" on the history window.
function foo()
///do stuff
subfunction()
end
function bar()
///do other stuff
subfunction()
end
function subfunction()
print whocalledme() ////<---what should this code be?
end
///do stuff
subfunction()
end
function bar()
///do other stuff
subfunction()
end
function subfunction()
print whocalledme() ////<---what should this code be?
end
You can start from
December 8, 2021 at 01:56 pm - Permalink
Perfect, thank you!
December 8, 2021 at 03:53 pm - Permalink