Skip to content

and

by admin on March 12th, 2017
if myNumber > 5 and myNumber < 100 then
  -- number is within range
end if

The and operator can be used to perform several comparisons in a row. It takes a boolean (true or false) as its left argument and another boolean as its right argument. If both are true, the and operator evaluates to true, but if even one of the arguments is false, (or both are), it also returns false.

Note: If you are familiar with other programming languages, note that neither & nor && are synonyms for and in Stacksmith.

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS