我正在做一个允许孩子们向圣诞老人发送信息的项目。不幸的是,如果他们在 AGE 字段中输入字符串而不是整数,程序会崩溃并返回从字符串“[exampleString]”到类型“Double”的转换无效。有没有办法检查他们是否输入了整数?这是代码。
If childAge > 0 And childAge < 150 Then
fmSecA2 = "Wow! You are already " & childAge & " years old? You're growing to be a big " & childGender & " now! "
Else
fmSecA2 = "Erm, I couldn't really understand your age. Are you making this up? Ho ho ho!"
End If
谢谢,凯:)