Alternative To A Specific Switch Statement

Ender Nafi Elekçioğlu endernafi at
Fri Mar 15 13:20:53 EDT 2013

Hi all,

Well, I like shorter codes.
Maybe it's an illusion of "the shorter, the faster" ?

Nevertheless, I seek a level of sophistication balanced with readability in my code.
A very, very simple example:

__put random(2) into tRandomNumber
__if tRandomNumber is 1 then
____put "L" into tLeftOrRight
____put "R" into tLeftOrRight
__end if


__put any item of "L,R" into tLeftOrRight

Isn't this much more elegant programming?
That was my intention by posting the question.

@Alex, Kee, Peter, David
I followed your advice,
did the calc once and used *sinCalc/abs(sinCalc)*

You're right, *if* would do just fine :)

@Jim Hurley
*atan2* function looks very promising, I'll dig deep; thanks...

Thanks, all of you…
I'm at the very beginning of that learning curve, you {all the gurus in lists and forums} helped a lot.


~ Ender Nafi

~ ·  … together, we're smarter … · ~

More information about the Use-livecode mailing list