Martin Verjans Martin Verjans - 29 days ago 5
Vb.net Question

if() not recognized in VB .Net 3.5 VS2012

I just asked a question, where the answer proposed to use the

If()
function.

I tried in my Visual Studio, but it seems not present...

Here is a screenshot of the Intellisense :
enter image description here

It only shows me the classical If structure.

When I write it out completely

If(True, Debug.Write("A"), Debug.Write("B"))


I get a syntax error, saying :


If must end by a corresponding End If


What am I missing here ?

.Net Framework 3.5

Visual Studio 2012 Express

The project is a Console Application and I tried also in Winforms...

Answer

The If() operator returns a value, try:

Debug.Write(If(True, "A", "B"))