Show/Hide Toolbars

XSharp

Only assignment, call, increment, decrement, and new object expressions can be used as a statement

 

The compiler generates an error when it encounters an invalid statement. An invalid statement is any line or series of lines ending in a semicolon that does not represent an assignment (=), method call (), new, -- or ++ operation. For more information, see Statements, Expressions, and Operators.

 

Example

 

The following sample generates XS0201 because 2 * 3 is an expression, not a statement. To make the code compile, try assigning the value of the expression to a variable.

 

 

// XS0201.prg  
 

 

Example

 

The following sample generates XS0201 because checked by itself is not a statement, even though it is parameterized by an increment operation.

 

 

// XS0201_b.prg  
// compile with: /target:library