共用方式為


在運算式中使用運算子

在協調流程運算式中也可以使用下列的 XLANG/s 運算子。 這些運算子幾乎完全符合 C# 中對應的運算子的功能。

運算子 描述 範例
checked() 在算術溢位時引發錯誤 checked(x = y * 1000)
unchecked() 忽略算術溢位 unchecked(x = y * 1000)
new 建立類別的執行個體 myObject = new MyClass;
typeof 類型擷取 myMapType = typeof(myMap)
succeeded() 測試交易式範圍或協調流程是否順利完成 目前範圍或服務>) <子交易的 (交易標識符
exists 測試訊息內容屬性是否存在 BTS.RetryCount exists Message_In
+ 一元加號 +(int x)
- 一元減號 -(int x)
! 邏輯否定 !myBool
~ 位元補數 x = ~y
() 強制型轉 (bool) myInt
* times Weight = MyMsg.numOrders * 20
/ 除以 x / y
+ plus x + y
- minus x - y
<< 左移 x << 2
>> 右移 x >> 2
< 小於 如果 (MyMsg.numOrders < 10) ...
> 大於 如果 (MyMsg.numOrders > 10) ...
<= 小於或等於 如果 (MyMsg.numOrders <= 10) ...
>= 大於或等於 如果 (MyMsg.numOrders >= 10) ...
== 等於 If (MyMsg.numOrders == 10)...
!= 不等於 If (MyMsg.numOrders != 10)...
& If (myByte & 255)...
^ 互斥 OR If (myByte ^ 1)...
| If (myByte | 1)...
&& 條件式 and 如果 (MyMsg.numOrders > 10) && (MyMsg.numOrders < 100)
|| 條件式 or 如果 (MyMsg.numOrders < 10) || (MyMsg.numOrders > 100)
// 註解 //這是註解

注意

一般表達式和篩選表示式與 接收 圖形使用的規則不同。

另請參閱

搭配使用篩選與接收訊息圖形