Operator Reference

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

ifelseifelseIfelseIfelseifelse (Operator)

ifelseifelseIfelseIfelseifelse — Conditional statement with alternative.

Warning

ifelseifelseIfelseIfelseifelse is obsolete and is only provided for reasons of backward compatibility. ififIfIfif should be used instead.

Signature

ifelse( : : Condition : )

Herror ifelse(const Hlong Condition)

Herror T_ifelse(const Htuple Condition)

void Ifelse(const HTuple& Condition)

static void HOperatorSet.Ifelse(HTuple condition)

def ifelse(condition: int) -> None

Description

ifelseifelseIfelseIfelseifelse is a conditional statement with an alternative. If the condition is true (i.e., not 0), all expressions and calls between the head and operator elseelseElseElseelse are performed. If the condition is false (i.e., 0) the part between elseelseElseElseelse and endifendifEndifEndifendif is executed. Note that the operator is called ifelseifelseIfelseIfelseifelse and it is displayed as if in the program text area.

Parameters

ConditionConditionConditionconditioncondition (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Condition for the if statement.

Default: 1

Result

If the condition is correct ifelseifelseIfelseIfelseifelse (as operator) returns 2 ( H_MSG_TRUE) . Otherwise, an exception is raised and an error code returned.

Alternatives

ififIfIfif

See also

elseelseElseElseelse, elseifelseifElseifElseifelseif, forforForForfor, whilewhileWhileWhilewhile, repeatrepeatRepeatRepeatrepeat, untiluntilUntilUntiluntil

Module

Foundation