IMHO, code that can be read clearly by humans is a lot more valuable than correct but unclear code. The real payoff comes in the later maintenance of the code, especially if it ever gets to be maintained by others. Harrie's response is in keeping with this ethic, and should be treated with a lot more respect than some of the multi-line statements seen in this thread.

But that's just my rant.  :-)

Russ

On Jan 27, 2007, at 9:25 PM, Norman Palardy wrote:


On Jan 27, 2007, at 5:52 PM, Lennox Jacob wrote:

Hello,

I would like to calculate the minimum, maximum and average of a set of editfields values.
I have 11 editfields - Editfield2 to Editfield12

The minimum value goes in an editfield named Min, The maximum value goes in an editfield named Max and the average value goes in an editfield named average.

So I have this code:
Average.Text = Str(Val(Days1.text) + (Val(Days2.text) + Val (Days3.text) + Val(Days4.text)+ Val(Days5.text) + Val(Days6.text)+ Val(Days7.text)+ Val(Days8.text)+ Val(Days9.text)+ Val(Days10.text) + Val(Days11.text))/11) Results.Text = "The minimum is “ + Min.text + “ days and the maximum is “ + Max.text + “ days, with an average of " + average.text + " days."

I can calculate average but I will need some help for minimum and maximum. I would like the app to find the minimum and maximum values that were inserted into the Editfield2 to Editfield12


the min is

min(min(min(min(min(min(min(min(min(min(Val(Days1.text), (Val (Days2.text)), Val(Days3.text)), Val(Days4.text)), Val (Days5.text)), Val(Days6.text)), Val(Days7.text)), Val (Days8.text)), Val(Days9.text)), Val(Days10.text)), Val(Days11.text)))

max is similar_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to