HIGH-VALUE,LOW-VALUE
COBOL
VB.NET
MinValue,MaxValueを使いますが、データ型毎に最大最小値が異なります。
文字列型はユニコードの最大値をHIGH-VALUEと同じように扱えます。
Module Module1
Private L As String = Char.MinValue '文字列型
Private H As String = Char.MaxValue
Private Imax As Integer = Integer.MaxValue ’整数型
Private Imin As Integer = Integer.MinValue
Private Dmax As Decimal = Decimal.MaxValue ’十進型
Private Dmin As Decimal = Decimal.MinValue
Private Tmin As DateTime = DateTime.MinValue '日付型
Private Tmax As DateTime = DateTime.MaxValue
Sub Main()
For i As Integer = 0 To 65535
If Convert.ToChar(i) >= H Then
Console.WriteLine("最大値はUnicode " & i & " です。")
End If
Next
Console.WriteLine("整数型最小値=" & Imin)
Console.WriteLine("整数型最大値=" & Imax)
Console.WriteLine("十進型最小値=" & Dmin)
Console.WriteLine("十進型最大値=" & Dmax)
Console.WriteLine("日付型最小値=" & Tmin)
Console.WriteLine("日付型最大値=" & Tmax)
End Sub
End Module
お役に立てましたか?
IT、プログラミングのランキングサイトはこちらです。
最新記事の自動受信登録はこちらです。 |
![]() |
![]() |
![]() |
![]() |
| 固定リンク








コメント