Documente Academic
Documente Profesional
Documente Cultură
' You can compare values with =, <>, >, <, >=, <=
' With logical operators Or and And you can check for
' multiple conditions
ElseIf intAge > 5 And intAge < 18 Then
Dim intGrade = intAge - 5
txtOutput &= "Go to grade " & intGrade & Environment.NewLine
Else
txtOutput &= "Go to college" & Environment.NewLine
End If
Case Else
' This is the default action
txtOutput &= "Go to college" & Environment.NewLine
End Select
txtOutput &= "Can you vote : " & boolCanVote & Environment.NewLine
' For loops execute the code within them a set number of times
For intNum = 1 To 10
txtOutput &= intNum & Environment.NewLine
Next
Dim numberGuessed = 0
' Do Until loops are used when you must have the code
' execute at least once
' The Do While loop continues looping as long as a condition
' is True
Do Until numberGuessed = randomValue
numberGuessed += 1
' You can exit a Do loop early
If numberGuessed = 10 Then Exit Do
Loop
For i = 0 To 3
For j = 1 To 3
matrix(i, j) = i & j
Next
Next
For i = 0 To 3
For j = 1 To 3
txtOutput &= matrix(i, j) & " "
Next
txtOutput &= Environment.NewLine
Next
TextBox1.Text = txtOutput
End Sub
End Class