DADiSP Worksheet Functions > Function Categories > Macro and Command File Functions > __CALLERFILENAME__
Returns the file name of the path of the caller SPL routine.
__CALLERFILENAME__
// 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.spl
__CALLERFILENAME__ returns the file name portion of the path of the caller of an SPL routine. An empty string is returned if there is no caller.
See __CALLERFILE__ to return the full path of the caller SPL.