01.11.2018, 04:44
You can do this on a few ways.
1) You can return before second if
2) You can nest your second if in the first
3) If in the first if there is only this secondd you can combine your conditions with AND gate
1) You can return before second if
Code:
12345678
if temp1 < temp2 then
-- do something
return -- could be with some value
end
if temp3 < temp4 then
-- do something
end2) You can nest your second if in the first
Code:
12345678
if temp1 < temp2 then
-- do something
if temp3 < temp4 then
-- do something
end
end3) If in the first if there is only this secondd you can combine your conditions with AND gate
Code:
123
if temp1 < temp2 and temp3 < temp4 then
-- do something
end
Done is better than perfect