Skip to main content
Version: 5.x

IF operator

The IF operator - creating a property implementing selection of a value by condition (single form).

Syntax

result IF condition 

Description

The IF operator creates a property that returns the given value when a certain condition is met. If the condition is not met, the property returns NULL.

Parameters

  • result

    Expression whose value defines the result.

  • condition

    An expression whose value defines the condition.

Examples

name = DATA STRING[100] (Book);
hasName (Book b) = TRUE IF name(b);

background (Book b) = RGB(224, 255, 128) IF b IS Book;

countTags (Book b) = GROUP SUM 1 IF in(b, Tag t);