How to get the max values

psevet

Member
Licensed User
Longtime 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
 

psevet

Member
Licensed User
Longtime User
Thank you very much Erel :sign0060:

You're the man !

Hope that Basic4Android makes you rich !

Cheers.

Pierre
 
Upvote 0
Top