I need an idea for a code to the following question:
A = 75
B = 1000
C = 25
D = 55
Wich one (A, B, C or D) is lowest...?
Best regards
Claus
lowest = A
lowName = "A"
If lowest > B Then
lowest = B
lowName = "B"
End If
You could also use:Best regards.B4X:lowest = Min(A, B) lowest = Min(lowest, C) lowest = Min(lowest, D)
If it's not required to find which variable has the lowest value - it is instead just the lowest value which is required then...
Add all values to a List and use the List Sort method.
That way you could easily get both the lowest value and the highest value if required.
Martin.