Hi Alain,
>Here is a function for only 1 condition but 3 cases : if it can be
>useful to anyone
>
>trif: func [
>
>
>...
>
>
>; example:
>print trif request "give an answer" ["yes"]["no"]["cancel"]
>
>by the way,
>is it good that "not none" equals "true" ?
>
>Alain Goy�.
>
>
yes, it is useful. The following improvement uses the [throw] attribute
to make the behaviour of the function more standard with respect to Return:
trif: func [
{Three case if}
[throw]
condition
iftrue [block!]
iffalse [block!]
ifnone [block!]
] [
do either condition [
iftrue
] [
either none? condition [
ifnone
] [
iffalse
]
]
]
; example:
f: does [trif request "give an answer" [return "yes"] [return "no"] [return "cancel"]
"Shoudn't get here"]
Merry Christmas
-Ladislav
--
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.