10 3 Isxxxxxx Intrinsic Functions

LANSA Technical

10.3 Isxxxxxx Intrinsic Functions

Many Intrinsic Function names begin with IS. This type of function will return a Boolean result, and can be thought of as a short form of an If/Else construct.

For example, the isnull intrinsic tests the value of the supplied value and returns a true if the value is blanks or zero.

Previously, testing for this situation would look like the following

If_Null Field(#Value)

Set Com(#Button) Enabled(True)

Else

Set Com(#Button) Enabled(False)

Endif

 

Using the intrinsic, we could write

If (#Value.IsNull)

Set Com(#Button) Enabled(True)

Else

Set Com(#Button) Enabled(False)

Endif

 

Clearly, this does not give any great benefit, unless combining with multiple conditions. However, we could write

#Button.Enabled := #Value.IsNull

 

In this example, as Isnull returns a Boolean state, it can be applied directly to any Boolean property.

This concept can be extended to use multiple conditions, And, Or and Not operators.

Ý 10. Intrinsic Functions