- Joined
- Oct 29, 2007
- Messages
- 1,184
Let's say I got five real variables with different values. Is there a formula to detect the variable with the lowest value?
local integer Lowest = 100000000000000000000000000 // Make this BIGGER than the biggest value
local integer MaxIndex = 5 // Your amount of values
local integer Index = 1
loop
exitwhen Index > MaxIndex
if Array{Index} < Lowest then
set Lowest = Array{Index}
endif
set Index = Index + 1
endloop
{Index}
= [Index]local integer Lowest = Array{0} //this is more efficient and i think that number you put in is greater than the biggest integer allowed
local integer NumValues = 5 // Your amount of values
local integer Index = 1
loop
exitwhen Index >= NumValues
if Array{Index} < Lowest then
set Lowest = Array{Index}
endif
set Index = Index + 1
endloop
{Index}
= [Index]local integer Lowest = 100000000000000000000000000 // Make this BIGGER than the biggest value
Integers can't sore any value above 2^31 - 1 (2147483647)
integer
is signed 4 byte int...integer
is signed 4 byte int...