How to get the max values

psevet

Member
Licensed User
Hello,

I'm stuck on a problem regarding comparison :

in a edittext I enter a value, eg 10
x=1.5
z= 0.5

I want my program to calculate (value1 * x) + (value2 * z) in a loop :

for i=1 to 20
for y= 1 to 20
temp=(i * x) + (y * z)
if temp<MyEditText.text then

Here I want to get the max value beetween the current temp and the previous one, then store the i and y values depending on this comparison in order to keep the maximum value and the corresponding i and y values at the end of both loops.

end if
next
next

This would be the way I would deal with this problem, but if I can get another solution I will take it.

Thanks for your help.

Pierre
 
Top