Thanks Russ,
I will try that, but an example code would be appreciated, know where I can 
locate one?
Thanks.
Lennox

Russ Jones <[EMAIL PROTECTED]> wrote: Hi Lennox.

Have you considered setting up the "Days" editfields as a control array?
If you did that, you could loop through the Days once, calculating  
DaySum, DayMin and DayMax as you go.
Then calculating Average is easy: just divide DaySum by the number of  
input Days fields.
The initial value for DayMin should be set to something higher than  
any allowed input value, then reduced as appropriate in the loop.
Similarly, the initial value for DayMax should be set to something  
lower than any allowed input value, and increased in the loop as  
appropriate.

HTH

Russ

On Jan 27, 2007, at 7: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
>
> Thanks.
>
> Lennox
>
>
>
> ---------------------------------
>  Get your own web address.
>  Have a HUGE year through Yahoo! Small Business.
> _______________________________________________
> Unsubscribe or switch delivery mode:
> 
>
> Search the archives of this list here:
> 

_______________________________________________
Unsubscribe or switch delivery mode:


Search the archives of this list here:



 
---------------------------------
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
_______________________________________________
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