__CALLERFILE__

Purpose:

Returns the full path name of the caller SPL routine.

Syntax:

__CALLERFILE__

Example:

// ctest.spl

ctest(x)

{

    return(ctest_div(x));

}

 

ctest_div(x)

{

    local str;

 

    if (argc < 1) x = 1;

 

    if (x == 0)

    {

        str = sprintf(strescape("Divide by 0\nFile: %s\nFunction: %s\nCaller: %s"),

                                __FILENAME__, __FUNC__, __CALLERFILE__);

        message(str);

 

        return;

    }

    

    return(1/x);

}

 

ctest(0)

 

displays the message:

 

Divide by 0

File: ctest.spl

Function: ctest_div

Caller: \myspl\ctest.spl

Remarks:

__CALLERFILE__ returns the full path name of the caller of an SPL routine. An empty string is returned if there is no caller.

 

See __CALLERFILENAME__ to return the file name portion of the full SPL path.

See Also:

#DEFAULT

#DEFINE

__CALLER__

__CALLERFILENAME__

__FILE__

__FILENAME__

__FUNC__

__LINE__