prmIsDefault Function

Ascertains whether a parameter for a method or function has reverted to the default parameter.


int prmIsDefault(anytype argument)

Parameter

Description

argument

The parameter to test.

1 if the method is called without a parameter and the default value for the parameter is used; otherwise, 0.

static void prmIsDefaultExample(Args _arg)
{
 
    void fn(boolean b = true, int j = 42)
    {
        ;
        if (prmIsDefault(b) == 1)
        {
            print "First parameter is using the default value.";
        }
 
        else
        {
            print "First parameter is not using the default value.";
        }
    }
    ;
    
    fn();
    fn(false);
    pause;
}

Community Additions

ADD
Show: