Skip to content

is a number

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

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

Use this operator to detect whether a value is a number. 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