Hi Rebols,

in the case anybody would like to have an as correct and general as possible
version of Ifs, here you are:

ifs: func [
    {If positive do positive-block, zero do zero-block, negative do
negative-block}
    [throw]
    condition [number! char! money! time!]
    positive-block [block!]
    zero-block [block!]
    negative-block [block!]
] [
    either positive? condition [do positive-block] [
        either negative? condition [do negative-block] [do zero-block]
    ]
]

Look out! It is necessary to write the arguments in correct order!

Regards
    Ladislav

Reply via email to