As (Visual Basic)

Introduces an As clause, which identifies a data type in a declaration statement or a constraint list on a generic type parameter.


The As keyword can be used in these contexts:

Aggregate Clause

Class Statement

Const Statement

Declare Statement

Delegate Statement

Dim Statement

Enum Statement

Event Statement

For...Next Statements

For Each...Next Statements

From Clause

Function Statement

Group Join Clause

Interface Statement

Operator Statement

Property Statement

Structure Statement

Sub Statement

Try...Catch...Finally Statements

See Also


How to: Create a New Variable


Data Types in Visual Basic

Variable Declaration in Visual Basic

Generic Types in Visual Basic


Type List

Visual Basic Language Keywords