qaisjp Posted July 30, 2011 Share Posted July 30, 2011 Would the following work instead of its respective other? if (type(t1) or type(y2)) ~= "table" then --instead of... if type(t1) ~= "table" or type(y2)~="table" then --be the same? and.. if method ==("ceil" or "floor") --instead of... if (method == "ceil" or method == "floor") --be the same? Link to comment
AGENT_STEELMEAT Posted July 30, 2011 Share Posted July 30, 2011 The LUA users wiki states it pretty well: If the first argument is not false or nil it is returned, otherwise the second argument is returned. So, a boolean is only returned if the first argument is true or the second argument is a boolean. So as far as your first snippet of code goes, only the second one would work properly. Also, for your second snippet of code, only the second would work properly. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now