' Visual Basic 2008 9.0 .NET Examples - Constants - Introduction to Visual Basic : Module Example1 Sub Main() Const pi As Double = 3.1415 ' Dim radius As Single = 10 ' Dim circumference As Double = radius * 2 * pi Dim area As Double = radius ^ 2 * pi ' Console.WriteLine("Circle Circumference : " & circumference) Console.WriteLine("Circle Area : " & area) ' Console.ReadLine() End Sub End Module Module Example2 Sub Main() Const red As Integer = &HFF0000 Const green As Integer = &HFF00 Const blue As Integer = &HFF ' Console.WriteLine("red : " & red) Console.WriteLine("green : " & green) Console.WriteLine("blue : " & blue) ' Const purple As Integer = red + blue ' Console.WriteLine("purple : " & purple) ' ' Console.ReadLine() End Sub End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.