投稿日 | : 2005/05/21(Sat) 01:55 |
投稿者 | : Starfish |
Eメール | : |
URL | : |
タイトル | : Re: VBのバグです |
以下確認用に使用したプログラムです。VB6.0のデバッグモードでかつ2回目以降に
現象が発生します。他は正常です。これって、やっぱりバグでしょう。
VB6.0起動直後に、リストボックスとコマンドボタンを貼り付けて
Private Sub Command1_Click()
Dim a As Double
Dim b As Single
Dim c As Variant
a = 0.0282 * 10000
b = 0.0282! * 10000
c = 0.0282 * 10000
List1.AddItem "Int(0.0282 * 10000)=" & CStr(Int(0.0282 * 10000))
List1.AddItem "Int(a)=" & CStr(Int(a))
List1.AddItem "Int(b)=" & CStr(Int(b))
List1.AddItem "Int(c)=" & CStr(Int(c))
End Sub
2回以上コマンドボタンを押してください。
又、コンパイルして、EXEファイルを実行して、同様に2回以上コマンドボタンを押してください。
ついでに、VB.netならこんな感じ?(2005のベータ1で確認)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim a As Double
Dim b As Single
Dim c As Object
a = 0.0282 * 10000
b = 0.0282! * 10000
c = 0.0282 * 10000
ListBox1.Items.Add("Int(0.0282 * 10000)=" & CStr(Int(0.0282 * 10000)))
ListBox1.Items.Add("Int(a)=" & CStr(Int(a)))
ListBox1.Items.Add("Int(b)=" & CStr(Int(b)))
ListBox1.Items.Add("Int(c)=" & CStr(Int(c)))
End Sub