元編程參考文件

布林例程

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)

參數

名稱型別預設值說明
左側真否—
右側真否—

返回

結果真否
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
布林例程
所屬包
標準庫