Livecode Wiki

Evaluates to true if a value is not of the specified type, false otherwise.Syntax:

<value> is not a[n] {boolean | integer | number | point | rect| date | color | ASCII string}

Examples:

22 is not a number
CJ22 is not a number
numToChar(128) is not an ASCII string -- evaluates to true

Use the is not a operator to validate data to make sure it's not the wrong type.

This operator is useful for checking whether the user has entered data correctly, and for checking parameters before sending them to a handler to avoid a script error caused by feeding data of one type to an operator or function that requires a different type.

A value is a:

  • boolean or logical if it is one of the two constants true or false


  • integer if it consists of digits (with an optional minus sign)


  • number if it consists of digits, optional leading minus sign, optional
 decimal point, and optional "E" or "e" (scientific notation)


  • point if it consists of two numbers separated by a comma


  • rect if it consists of four numbers separated by commas


  • date if it is in one of the formats produced by the date or time
 functions 


  • color if it is a valid color reference


  • ASCII string if it does not contain any characters greater than
 charToNum(127) 


All the types other than boolean can also include leading or trailing white space characters.

The is not a operator is the logical inverse of the is a operator. When one is true, the other is false.

Parameters:

  • value: Any source of value.

See also: is a (operator),