VB新手求求各位大神解答,万分感谢!!!

Dim num11 As String
Dim num8 As String
Dim num7 As String
Dim num9 As String
Dim num11 As String
Dim num10 As String
num9 = TextBox11.Text
num10 = TextBox12.Text
num11 = TextBox13.Text
num7 = num1 / (0.25 * 3.14 * 0.6 * 0.6) / 3600
num8 = num2 / (12.7 * 31) / 3600
TextBox11.Text = 0.021 * (num7 * 0.6 / 81.2 / 10 ^ (-6)) ^ (0.84) * 0.595 ^ (0.36) * (0.615 / 0.61) ^ (0.25) * 0.0699 / 0.6
TextBox12.Text = 0.021 * (num8 * 0.6 / 79.3 / 10 ^ (-6)) ^ (0.84) * 0.7 ^ (0.36) * (0.7 / 0.7) ^ (0.25) * 0.0562 / 0.6
TextBox13.Text = num9 * num10 / (num9 + num10)
错误就是TextBox13.Text = num9 * num10 / (num9 + num10)这一行,我有很多这个样子的语句,都是个错误,是最前面定义的错误,还是其他的?
求各位大神帮帮我这个菜鸟吧,谢谢各位大神了!

2个回答

 Dim num11 As double
Dim num8 As double
Dim num7 As double
Dim num9 As double
Dim num11 As double
Dim num10 As double
num9 = CDbl(TextBox11.Text)
num10 = CDbl(TextBox12.Text)
num11 = CDbl(TextBox13.Text)
num7 = num1 / (0.25 * 3.14 * 0.6 * 0.6) / 3600
num8 = num2 / (12.7 * 31) / 3600
TextBox11.Text = CSTR(0.021 * (num7 * 0.6 / 81.2 / 10 ^ (-6)) ^ (0.84) * 0.595 ^ (0.36) * (0.615 / 0.61) ^ (0.25) * 0.0699 / 0.6)
TextBox12.Text = CSTR( 0.021 * (num8 * 0.6 / 79.3 / 10 ^ (-6)) ^ (0.84) * 0.7 ^ (0.36) * (0.7 / 0.7) ^ (0.25) * 0.0562 / 0.6)
TextBox13.Text =  CSTR(num9 * num10 / (num9 + num10))

VB是会自动进行类型转换的。你的错误是重复定义了两次 num11 变量。

你的代码有太多或太复杂的编译错误,导致VB-IDE无法正确指明编译错误的代码位置。
在“Tools\Options...”中将General下的“Compile on demand”选项取消,将代码全注释起来,逐个恢复逐个编译,最后全编译通过就OK了。

恭喜获得成就——代码烂到程序都读不懂☆

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐