Visual Basic Language Keywords
This page is specific to:.NET Framework Version:1.12.03.03.5
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

Community Content

code for stream writer and reader
Added by:studennt

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
© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View