any2Int Function

Converts the object parameter to its equivalent integer. The object parameter can be of almost any data type, but useful output is obtained for enum, real, str and int.


int any2Int(anytype object)

Parameter

Description

object

The value to convert.

An integer.

static void any2IntExample(Args _args)
{
    int convert(anytype _value)
    {
        if (typeof(_value) == Types::Integer)
        {
            return any2Int(_value);
        }
    }
    ;

    print convert(42);
    pause;
}

Community Additions

ADD
Show: