Show/Hide Toolbars

XSharp

The -modernsyntax compiler option disables some legacy language features

These features are

 

&& for single line comments

? Today() && Show today's date

* for whole line comments

* The next line calls DoSomething()
? DoSomething()

Bracketed strings

? ["''"] // use brackets to include quotes in a literal string

Parenthesized expression lists

var x := IIF(Dow() == 1, (Open(), DoSomeWork(), Close()), 42)

These were used by some users to include more than one expression / function call on locations where a single expression was expected, such as inside an IIF() expression. If -modernsyntax is not enabled then the compiler will generate a local function with (in this example) 3 expression statements and insert a call to the local function in the IIF() expression.

 

To set this compiler option in the Visual Studio development environment:

 

1.Open the project's Properties page.

2.Click the Language tab.

3.Change "Modern Syntax" value of checkbox

4.Click here to see the property page