Syntax Error
Syntax Error

Reputation: 1640

What does this line of VB code do?

I can't wrap my head around this code I found in an old project that someone else wrote. I'm not a VB person. Didn't have a lot of luck Googling this syntax. Can anyone explain it to me, particularly the True : bool = false bit?

 If drpdnTeam.Text = "" Then lblTeam.Visible = True : bool = False Else lblTeam.Visible = False

Upvotes: 0

Views: 92

Answers (1)

Nico Schertler
Nico Schertler

Reputation: 32637

: is a statement separator. So another way of writing this code is:

If drpdnTeam.Text = "" Then 
    lblTeam.Visible = True
    bool = False
Else
    lblTeam.Visible = False
End If

bool is probably just a variable (or property) and the value False is assigned to it.

Upvotes: 2

Related Questions