Imports System
Class Sample
Public Shared Sub Main()
End Sub
Public Sub MinMaxFields(ByVal numberToSet As Integer)
If numberToSet <= CInt([Byte].MaxValue) And numberToSet >= CInt([Byte].MinValue) Then
Dim MemberByte As Byte = CType(numberToSet, [Byte])
Console.WriteLine("The MemberByte value is {0}.", MemberByte.ToString())
Else
Console.WriteLine("The value {0} is outside of the range of possible Byte values.", numberToSet.ToString())
End If
End Sub
End Class