# $features

Returns the features that KVIrc supports

Usage

    $features()
    $features(<test_feature>)

Description

The parameterless form returns an array of feature descripton strings that this KVIrc executable supports.
This function is useful when some part of your script depends on an optional KVIrc feature (like SSL support or IPV6 support).
The returned value may be assigned to a dictionary too: it will be used to simulate an array.
The form with the [test_feature] parameter returns true if and only if [test_feature] is available.

Syntax Specification

    <array> $features()
    <boolean> $features(<test_feature:string>)

Examples

    %myfeats[] = $features
    echo %myfeats[]
    %i = %myfeats[]#
    while(%i > 0)
    {
        echo "Supporting feature %myfeats[%i]"
        %i--;
    }

Nearly the same loop, just really shorter:

    foreach(%f,$features)
        echo "Supporting feature %myfeats[%i]"

You can test for a specific feature in the following way:

    if($features("SSL"))echo "Yes! SSL is available";

If used in "non-array" context it returns just a comma separated list of entries:

    echo $features

See also
$version

Index, Functions

KVIrc 4.0.2.4740 Documentation
Generated by root at Tue Feb 1 06:16:04 2011