SIMPOL Documentation

Selection Functions

This section contains the intrinsic functions that are used for selecting a value from a group of values.

.if()

Prototype

.if( <expression> , <retvaltrue> , <retvalfalse> )

Return types

.nul, .inf, string, boolean, integer, number

Description

The .if() function outputs the second or the third parameter, depending on the value of the first parameter.

Parameters

expression
Type nameResult for an expression of this type in this parameter
.nul The result is the value of the third parameter
.inf The result is the value of the second parameter
string If the string is not the empty string then the result is the value of the second parameter, otherwise it is the value of the third parameter
boolean If the value of the boolean is .true then the result is the value of the second parameter, otherwise it is the value of the third parameter
integer If the value of the integer is non-zero then the result is the value of the second parameter, otherwise it is the value of the third parameter
number If the value of the number is non-zero then the result is the value of the second parameter, otherwise it is the value of the third parameter
Result if Expression is True

Type nameResult for an expression of this type in this parameter
.nul The result may be .nul
.inf The result may be .inf
string The result may be this value
boolean The result may be this value
integer The result may be this value
number The result may be this value

Result if Expression is False

Type nameResult for an expression of this type in this parameter
.nul The result may be .nul
.inf The result may be .inf
string The result may be this value
boolean The result may be this value
integer The result may be this value
number The result may be this value

.min()

Prototype

.min( <…> )

Return types

.nul, .inf, string, integer, number, boolean

Description

Returns the minimum of any number of parameters. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Parameters

Variable

.max()

Prototype

.max( <…> )

Return types

integer, number, boolean, .inf, .nul

Description

Returns the maximum of any number of parameters. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Parameters

Variable