元编程参考文档

布尔例程

5 个节点

本页内容 5

与

函数

Logical AND (&&). Returns true only if both operands are true.

签名
与(左侧: 真否, 右侧: 真否) -> 真否
bool And(bool left, bool right)

参数

名称类型默认值说明
左侧真否—
右侧真否—

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
布尔例程
所属包
标准库

选择

函数

重载 1/2

签名
选择(条件: 真否, 为真时: 文本, 为假时: 文本) -> 文本
string Choose(bool condition, string whenTrue, string whenFalse)

One of two texts, by a condition: the ternary operator (condition ? whenTrue : whenFalse).

参数

名称类型默认值说明
条件真否—
为真时文本—
为假时文本—

返回

结果文本

备注

Typed overloads rather than the obsolete LogicRoutines.Choose(bool, object, object), which
answered object and so could not feed a typed pin. A choice made by DATA is what keeps a
procedural callback one chain where a Branch - which does not rejoin - would repeat every statement
after the choice once per arm.

重载 2/2

签名
选择(条件: 真否, 为真时: 数字, 为假时: 数字) -> 数字
double Choose(bool condition, double whenTrue, double whenFalse)

One of two numbers, by a condition: the ternary operator (condition ? whenTrue : whenFalse).

参数

名称类型默认值说明
条件真否—
为真时数字—
为假时数字—

返回

结果数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
布尔例程
所属包
标准库

非

函数

Logical NOT (!). Inverts the boolean value.

签名
非(值: 真否) -> 真否
bool Not(bool value)

参数

名称类型默认值说明
值真否—

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
布尔例程
所属包
标准库

或

函数

Logical OR (||). Returns true if at least one operand is true.

签名
或(左侧: 真否, 右侧: 真否) -> 真否
bool Or(bool left, bool right)

参数

名称类型默认值说明
左侧真否—
右侧真否—

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
布尔例程
所属包
标准库

逻辑异或

函数

Logical exclusive OR (XOR). Returns true if exactly one operand is true.

签名
逻辑异或(左侧: 真否, 右侧: 真否) -> 真否
bool Xor(bool left, bool right)

参数

名称类型默认值说明
左侧真否—
右侧真否—

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
布尔例程
所属包
标准库