Wednesday, March 5, 2008

Enumerations of VB.

_____________________________________________

Enumerations of VB.

_____________________________________________

Enum Action
Start
[Stop] ' Stop is a reserved word
Rewind
Forward
End Enum

Enum Status
Flunk = 50
Pass = 70
Excel = 90
End Enum

Dim a As Action = Action.Stop
If a <> Action.Start Then _
Console.WriteLine(a.ToString & " is " & a) ' Prints "Stop is 1"

Console.WriteLine(Status.Pass) ' Prints 70
Console.WriteLine(Status.Pass.ToString()) ' Prints Pass

____________________________________________________________________

Note:Applicable for .net also asp.net.
____________________________________________________________________

No comments: