求教大神:编写的一段程序,需要点击好几次才能出现正确结果,求教问题原因。
Sub Command1_Click()Form2.Show
End Sub
Private Sub Command3_Click()
Mar = Val(Text1.Text)
Cdc = Val(Text7.Text)
trc = Val(Text2.Text)
M = Val(Text3.Text)
Fin = Val(Text5.Text)
t1 = Val(Label38.Caption)
Cag1 = Val(Text9.Text)
Cs = Val(Text11.Text)
ts = Val(Text8.Text)
Fmff = Val(Text10.Text)
e = Val(Text12.Text)
Ch2o = Val(Text6.Text)
t2 = Val(Text4.Text)
Ca2 = Val(Text13.Text)
Crc = Val(Label37.Caption)
Cdc1 = Val(Text17.Text)
Mpc = Val(Text14.Text)
Qrc = Val(Label40.Caption)
Qev = Val(Label46.Caption)
Fout = Val(Label50.Caption)
Qag1 = Val(Label41.Caption)
Qag2 = Val(Label47.Caption)
Msj = Val(Text16.Text)
Qs = Val(Label42.Caption)
Qf = Val(Label48.Caption)
r = Val(Text15.Text)
Qmac = Val(Label43.Caption)
Qxtsr = Val(Label49.Caption)
V0ut = Val(Label51.Caption)
Qin = Val(Label44.Caption)
Qout = Val(Label39.Caption)
Fr = Val(Label45.Caption)
Qev = (Mar - Mpc) / (100 - Mpc) * M * (2500 + Ch2o * t2 - 4.187 * trc)
Label46.Caption = Qev
Crc = ((100 - Mar) * Cdc + 4.187 * Mar) / 100
Label37.Caption = Crc
Fout = Fin / 1.285 + (Mar - Mpc) / (100 - Mpc) * M / 0.804 + Fmff / 1.285
Label50.Caption = Fout
Qag2 = (Fin + Fmff) * t2 * Ca2
Label47.Caption = Qag2
Qs = ts * Fmff * Cs
Label42.Caption = Qs
Qf = (1 - 0.01 * Mar) * (t2 - trc) * (Cdc1 + 4.187 * Mpc / (100 - Mpc)) * M
Label48.Caption = Qf
Qmac = 2.16 * M * e
Label43.Caption = Qmac
Qrc = Crc * trc * M
Label40.Caption = Qrc
t1 = (Qout - Qmac - Qs - Qrc) / (Fin * Cag1)
Label38.Caption = t1
Qag1 = t1 * Cag1 * Fin
Label41.Caption = Qag1
Qin = Qrc + Qag1 + Qs + Qmac
Label44.Caption = Qin
Qxtsr = 0.02 * Qin
Label49.Caption = Qxtsr
Qout = Qev + Qag2 + Qf + Qxtsr
Label39.Caption = Qout
Fr = Fout * (101.3 / 86.7) * (273 + t2) / 273
Label45.Caption = Fr
Vout = Fr / 3600 / (3.14 * r * r * 4)
Label51.Caption = Vout
End Sub