Re: tildewasaquestionmark
>Date: Wed, 24 Jun 1998 22:38:12 -0400
>From: Robert B Pilkington <bpilkington at JUNO.COM>
>Subject: Re: To David, Ralf (3), Lewis, Joe (2),
> but all may read (Rob Craig should)
>
>Well, let's see, I think that means:
>
>atom x
>if sequence(a) then
> x = length(a)
>else
> x = 1
>end if
>? x
Correct.
>So that means we can have a function! :)
>
>global function tildewasquestionmark(atom boolean, object o1, object o2)
> -- If boolean is true then return o1, otherwise return o2, and
> -- it's only 4 or 5 statements! :) (Dunno if 'else' is counted.)
> if boolean then
> return o1
> else
> return o2
> end if
>end function
if boolean then return o1 end if return o2 --> no else for sure
>? tildewasquestionmark(sequence(a), length(a), 1)
BOOM! this produces an error since you can't call iif(0, ERROR, 1).
Tried before replying?
>(You may want to change the function name to something a little more
>understandable... :) Although the current method is probably more
>understandable than what it was.. ;)
I prefer iif (Immediate IF). Taken from Visual Basic, not C.
|
Not Categorized, Please Help
|
|