Friday 16 September 2011

Define variable inside If statement

public class Test
   public Shared Sub Main

        Dim manager As Boolean = True
        If manager Then Dim txt As String = "M" : Console.WriteLine(txtElse _
            Dim txt As String = "E" : Console.WriteLine(txt)

   End Sub
End class

No comments:

Post a Comment