Skip to content

is an integer

by admin on April 7th, 2017
if myVar is an integer then
  add 5 to myVar
  put myVar && "+ 5" into myVar
end if

if otherVar is not an integer then
  -- complain that we need a whole number here
end if

Use this operator to detect whether a value is not only a number, but an integer (i.e. a number without a fractional part). This is useful to e.g. verify whether a text field contains a number before trying to add a number to it, for validating user input.

No comments yet

Leave a Reply

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

Subscribe to this comment feed via RSS