__LINE__

Purpose:

Returns the current line number in the current SPL routine.

Syntax:

__LINE__

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, __FILENAME__, __FUNC__);

        message(str);

 

        return;

    }

    

    return(1/x);

}

 

ltest(0)

 

displays the message:

 

Divide by 0 Near Line: 9

File: ltest.spl

Function: ltest

Remarks:

__LINE__ returns the line number as in integer.

See Also:

#DEFAULT

#DEFINE

__CALLER__

__CALLERFILE__

__CALLERFILENAME__

__FILE__

__FILENAME__

__FUNC__