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 (算子名称)

名称

ifelseifelseIfelseIfelseifelse — Conditional statement with alternative.

警告

ifelseifelseIfelseIfelseIfelseifelse is obsolete and is only provided for reasons of backward compatibility. ififIfIfIfif should be used instead.

参数签名

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

描述

ifelseifelseIfelseIfelseIfelseifelse 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 elseelseElseElseElseelse are performed. If the condition is false (i.e., 0) the part between elseelseElseElseElseelse and endifendifEndifEndifEndifendif is executed. Note that 该算子 is called ifelseifelseIfelseIfelseIfelseifelse and it is displayed as if in the program text area.

参数表

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

Condition for the if statement.

Default: 1

结果

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

可替代算子

ififIfIfIfif

参考其它

elseelseElseElseElseelse, elseifelseifElseifElseifElseifelseif, forforForForForfor, whilewhileWhileWhileWhilewhile, repeatrepeatRepeatRepeatRepeatrepeat, untiluntilUntilUntilUntiluntil

模块

Foundation