Entry
How much of C# syntax can you use in an Expression shape?
Apr 6th, 2005 22:26
Balaji Ramachandran, http://www.netologi.se/default.aspx?Contents=BizTalkFAQ
There are multiple limitations to the syntax in an expression shape.
The main reason for this is that the language is NOT C#, but rather
XLANG/S. The syntax is identical on supported languge constructs, but
the limitations area many. As XLANG/S is so similar to C# in syntax you
end up writing C#, just to be reminded of that you cannot use that
construct or that keyword.
Arrays are not supported.
Indexers or parameterized properties are not supported. The lack of
support for indexers are tightly coupled to the lack of support for
arrays. This means that you cannot write code like this: res = coll[3];
You cannot to call-chaining, e.g. xmlDoc.Nodex.Count.ToString() is
illegal as you cannot call the ToString method. The worka-round for
this scenario is to use System.Convert.ToString(xmlDoc.Nodes.Count).
No support for using, this means that you need to use the
namespace.class syntax all the time.
foreach, for, do/while, break and continue are not supported.
Simple types (integer, string, floating point) cannot have the dot
operator applied to them. I.e, you cannot write code like this:
6.ToString();
Comments work fine, but you need at least one statement in the
expression box.
Compound assignment (+=, -=, *=, etc) is not supported.
Nor is it support to usemore than one assignment operator in a
statement.
Assignment within an “if” or “while” predicate is not supported.
Increment, decrement are not supported (++, --).
For message parts, the only member access allowed is on distinguished
fields.
Delegates and events are not supported.
In construct shapes you cannot do any control flow (if/else or while).