Re: A more Euphorian Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

Andy Serpa writes:
> The conditional operator.

Thanks. I've added it to my list of ideas.

Instead of this code:

for i = 1 to length(x) do
    element = x[i]
    if element < threshold then
        element *= 2
    else
        element *= 4
    end if
    x[i] = element
end for

you could shrink it slightly to:

for i = 1 to length(x) do
    if x[i] < threshold then
        x[i] *= 2
    else
        x[i] *= 4
    end if
end for

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu