如以下程式:
本人先定义chang为双精度,然后通过输入chang来定Hchang,可是发现输入整数后,Hchang也不为0,请问为什么?
Dim chang As Double, Hchang As Double chang = InputBox("input a double", "input") If VarType(chang) = vbInteger Then Hchang = 0 Else Hchang = Val(Right(CStr(chang), 1)) End If MsgBox Hchang
|