DADiSP Worksheet Functions > Function Categories > Macro and Command File Functions > __FILE__

 

__FILE__

Purpose:

Returns the full path name of the current SPL routine.

Syntax:

__FILE__

Example:

 

// ltest.spl

ltest(x)

{

    local line, str;

 

    if (argc < 1) x = 1;

 

    line = __LINE__;

    

    if (x == 0)

    {

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

                                line, __FILE__, __FUNC__);

        message(str);

 

        return;

    }

    

    return(1/x);

}

 

ltest(0)

 

displays a message similar to:

 

Divide by 0 Near Line: 9

File: \myspl\ltest.spl

Function: ltest

Remarks:

__FILE__ returns the full SPL path name as a string.

 

See __FILENAME__ to return the file name portion of the full path as a string.

See Also:

#DEFAULT

#DEFINE

__CALLER__

__CALLERFILE__

__CALLERFILENAME__

__FILENAME__

__FUNC__

__LINE__