Lingo Dictionary > G-K > integerP() |  |

integerP()

Syntax

    expression.integerP
    (numericExpression).integerP
    integerP(expression)

Description

Function; indicates whether the expression specified by `expression` can be evaluated to an integer (`1 or TRUE`) or not (`0 or FALSE`). P in `integerP` stands for predicate.

Example

This statement checks whether the number 3 can be evaluated to an integer and then displays 1 (`TRUE`) in the Message window:

    put(3).integerP
    -- 1

Example

This statement checks whether the number 3 can be evaluated to an integer. Because 3 is surrounded by quotation marks, it cannot be evaluated to an integer, so 0 `(FALSE`) is displayed in the Message window:

    put("3").integerP
    -- 0

Example

This statement checks whether the numerical value of the string in field cast member Entry is an integer and if it isn't, displays an alert:

    if field("Entry").value.integerP = FALSE then alert "Please enter an integer."

See also

`floatP()`, `integer()`,`ilk()`, `objectP()`, `stringP()`, `symbolP()`