odd number and even numbers
william humphrey
bill at bluewatermaritime.com
Mon Aug 17 15:58:20 EDT 2009
That's even better. Thanks. Never heard of step.
On Mon, Aug 17, 2009 at 3:55 PM, Colin Holgate <coiin at rcn.com> wrote:
> Another approach is to use Step in your repeat loop. See this:
>
> on test
> repeat with a = 1 to 10 step 2
> put return & a*3 after msg
> put return & sqrt(a+1) after msg
> end repeat
> end test
>
> For odd numbers a*3 will be put, and for even numbers the square root of
> the number will be put. Doing it that way involves no if statements, and no
> function calls.
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
--
http://www.bluewatermaritime.com
More information about the use-livecode
mailing list