Returns the name of the caller SPL routine.
__CALLER__
// ctest.spl
ctest(x)
{
return(ctest_div(x));
}
ctest_div(x)
{
local str;
if (argc < 1) x = 1;
if (x == 0)
{
str = sprintf(strescape(
message(str);
return;
}
return(1/x);
}
ctest(0)
displays the message:
Divide by 0
File: ctest.spl
Function: ctest_div
Caller: ctest
__CALLER__ returns the caller of an SPL routine as a string. An empty string is returned if there is no caller.
See __FUNC__ to return the name of the current SPL routine.