kendall anderson wrote:
> ...
> I realize this could be done with:
> if (total > 0) then
>         dpercent = score/total
> else
>         dpercent = 0
> end if
> return dpercent
> 
> I'm just looking for a more compact, more 'elegant' solution. I also
> understand this is really a minor point. :)



Elegance is in the eye of they next poor sod to try to figure out the code.
Compact but only so readable:

dpercent = [0,score/total][1+(total>0)]
or
dpercent = [score/total,0][2-(total>0)]


for that matter, something like this might get you where you want to go:

dpercent = int(score/max(.0001,total))



-- 
Carl West    [EMAIL PROTECTED]
617.262.8830 x246    
--------------------
To gain face, give it
To lose face, try to save it 
Or take it away 
                   - F. Eysenkopf

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to