Visual Basic Language Reference
Visual Basic Language Keywords

The following tables list all the Visual Basic language keywords.

Reserved Keywords

The following keywords are reserved, which means you cannot use them as names for your programming elements such as variables or procedures. You can bypass this restriction by enclosing the name in brackets ([ ]). For more information, see "Escaped Names" in Declared Element Names.

NoteNote:

Using escaped names is not recommended, because it can make your code hard to read, and can lead to subtle errors that can be difficult to find.

NoteNote:

EndIf, GoSub, Variant, and Wend are retained as reserved keywords, although they are no longer used in Visual Basic. The meaning of the Let keyword has changed. Let is now used in LINQ queries. For more information, see Let Clause (Visual Basic).

Unreserved Keywords

The following keywords are not reserved, which means you can use them as names for your programming elements. However, doing this is not recommended, because it can make your code hard to read and can lead to subtle errors that can be difficult to find.

See Also

Reference

Tags :


Community Content

studennt
code for stream writer and reader

Dim szname As String
Try
Using sw As IO.StreamWriter = New IO.StreamWriter("\\mydocuments\names.txt")
For n As Integer = 0 To Lstbox.Items.Count - 1
szname = Lstbox.Items(n).ToString
sw.Write(szname)
sw.WriteLine()
Next
sw.Close()
End Using
Catch ex As Exception
End Try



stream reader

Dim srname As String
Try
Using sr As IO.StreamReader = New IO.StreamReader("\\mydocuments")
Do While Not sr.EndOfStream
srname = sr.ReadLine
Lstbox.Items.Add(srname)
Loop
sr.Close()
End Using
Catch ex As Exception
End Try


Private Sub Lstbox_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Lstbox.DoubleClick
Dim n As Integer
Name = Lstbox.SelectedIndex
If n >= 0 Then
MessageBox.Show(Lstbox.Items(n).ToString)
End If


message box

Dim LeftPos As Integer
'student id
If (IsNumeric(TxtstudentID.Text)) Then
If (Val(TxtstudentID.Text) >= 0 And Val(TxtstudentID.Text) <= 9999999) Then
LeftPos = Val(TxtstudentID.Text)
Else
MessageBox.Show("Invalid number")
End If
Tags :

Page view tracker