Double 和 Integer 类型的问题
Issue with Double and Integer type
我在检查卡号长度时遇到问题,但由于我是 vb.net 的新手,所以无法破译它。请帮帮我
dim C as Double
C = CDbl(Val(InputBox("Kindly enter the card number", "Card Number")))
if len(C) <> 15 then
msgbox("something...")
endif
即使输入了15位卡号,也是进入if条件
使用字符串怎么样?
Dim C As String
C = InputBox("Kindly enter the card number", "Card Number")
If Len(C) <> 15 Then
MsgBox("something...")
End If
Len() returns变量C使用的字节数。
Double 正在使用 64 位,实际上:Len(C) = 8
https://msdn.microsoft.com/en-us/library/f0ycy938(v=vs.110).aspx
我在检查卡号长度时遇到问题,但由于我是 vb.net 的新手,所以无法破译它。请帮帮我
dim C as Double
C = CDbl(Val(InputBox("Kindly enter the card number", "Card Number")))
if len(C) <> 15 then
msgbox("something...")
endif
即使输入了15位卡号,也是进入if条件
使用字符串怎么样?
Dim C As String
C = InputBox("Kindly enter the card number", "Card Number")
If Len(C) <> 15 Then
MsgBox("something...")
End If
Len() returns变量C使用的字节数。
Double 正在使用 64 位,实际上:Len(C) = 8
https://msdn.microsoft.com/en-us/library/f0ycy938(v=vs.110).aspx