jleips2600
New Member
- Reaction score
- 4
Is there any sort of function to limit a variables max/min?
ei) x = 0
constant_max = 20
constant_min = -10
magicalfunction(x, constant_max, constant_min)
if x > y
x = y
elseif x < z
x = z
endif
return x
doing this would allow you to check if x has gone beyond the max or min, and if it has, set it to the max or min.
Im pretty sure there's a term for this function, but alas I'm not a programmer.
Regardless, does such a function exist in Galaxy Editor that I just can't seem to find it?
Thank you in advanced sweet, sweet community =D
ei) x = 0
constant_max = 20
constant_min = -10
magicalfunction(x, constant_max, constant_min)
if x > y
x = y
elseif x < z
x = z
endif
return x
doing this would allow you to check if x has gone beyond the max or min, and if it has, set it to the max or min.
Im pretty sure there's a term for this function, but alas I'm not a programmer.
Regardless, does such a function exist in Galaxy Editor that I just can't seem to find it?
Thank you in advanced sweet, sweet community =D