hosein3000
یک شنبه 21 اسفند 1390, 16:40 عصر
با سلام دوستان
من از if تو در تو برای برنامه ام استفاده کردم اول شرط ها رو بخوبی بررسی می کنه ولی اومدم با else دو شرط جدید اضافه کردم اصلا اونا رو بررسی نمی کنه هر کاری هم کردم درست نشد که نشد. یعنی جاهای if ها و else ها رو عوض کردم نشد.
به عنوان نمونه کد زیر شرط اول رو بررسی می کنه میبینه درسته دیگه نمیره سراغ شرط دومی
به نظر شما چیکار کنم دومی رو هم بررسی کنه
If Combo7.Text = "other systemÇ" And Combo8.Text = "tip4" Then
Text14.Text = 0.05 * Val(Text15.Text) ^ (3 / 4)
Text13.Text = "0.15"
Text12.Text = "1"
Text11.Text = "1.75"
If "0" <= Val(Text14.Text) <= Val(Text13.Text) Then
Text10.Text = 1 + Val(Text11.Text) * (Val(Text14.Text) / Val(Text13.Text))
Option6.Value = True
End If
If Val(Text13.Text) <= Val(Text14.Text) <= Val(Text12.Text) Then
Text10.Text = Val(Text11.Text) + 1
Option5.Value = True
End If
If Val(Text14.Text) >= Val(Text12.Text) Then
Text10.Text = (Val(Text11.Text) + 1) * (Val(Text12.Text) / Val(Text14.Text)) ^ (2 / 3)
Option4.Value = True
End If
Else
If Combo1.Text = "unsafe zone" And Combo7.Text = "other system" And Combo8.Text = "tip4" Then
Text14.Text = 0.05 * Val(Text15.Text) ^ (3 / 4)
Text13.Text = "0.15"
Text12.Text = "1"
Text11.Text = "22222222222222"
If "0" <= Val(Text14.Text) <= Val(Text13.Text) Then
Text10.Text = 1 + Val(Text11.Text) * (Val(Text14.Text) / Val(Text13.Text))
Option6.Value = True
End If
If Val(Text13.Text) <= Val(Text14.Text) <= Val(Text12.Text) Then
Text10.Text = Val(Text11.Text) + 1
Option5.Value = True
End If
If Val(Text14.Text) >= Val(Text12.Text) Then
Text10.Text = (Val(Text11.Text) + 1) * (Val(Text12.Text) / Val(Text14.Text)) ^ (2 / 3)
Option4.Value = True
End If
تفاوت شرط اول با دوم در unsafe zone هست . یعنی اگر شرط اول برقرار بشه تسکت باکس ها یه مقدار خاص بگیریند ولی اگر combobox11 بشه unsafe zone مقادیر تسکت باکس ها عوض بشن
این میبینه چون شرط اولی برقراره دیگه combo11 رو چک نمی کنه
من از if تو در تو برای برنامه ام استفاده کردم اول شرط ها رو بخوبی بررسی می کنه ولی اومدم با else دو شرط جدید اضافه کردم اصلا اونا رو بررسی نمی کنه هر کاری هم کردم درست نشد که نشد. یعنی جاهای if ها و else ها رو عوض کردم نشد.
به عنوان نمونه کد زیر شرط اول رو بررسی می کنه میبینه درسته دیگه نمیره سراغ شرط دومی
به نظر شما چیکار کنم دومی رو هم بررسی کنه
If Combo7.Text = "other systemÇ" And Combo8.Text = "tip4" Then
Text14.Text = 0.05 * Val(Text15.Text) ^ (3 / 4)
Text13.Text = "0.15"
Text12.Text = "1"
Text11.Text = "1.75"
If "0" <= Val(Text14.Text) <= Val(Text13.Text) Then
Text10.Text = 1 + Val(Text11.Text) * (Val(Text14.Text) / Val(Text13.Text))
Option6.Value = True
End If
If Val(Text13.Text) <= Val(Text14.Text) <= Val(Text12.Text) Then
Text10.Text = Val(Text11.Text) + 1
Option5.Value = True
End If
If Val(Text14.Text) >= Val(Text12.Text) Then
Text10.Text = (Val(Text11.Text) + 1) * (Val(Text12.Text) / Val(Text14.Text)) ^ (2 / 3)
Option4.Value = True
End If
Else
If Combo1.Text = "unsafe zone" And Combo7.Text = "other system" And Combo8.Text = "tip4" Then
Text14.Text = 0.05 * Val(Text15.Text) ^ (3 / 4)
Text13.Text = "0.15"
Text12.Text = "1"
Text11.Text = "22222222222222"
If "0" <= Val(Text14.Text) <= Val(Text13.Text) Then
Text10.Text = 1 + Val(Text11.Text) * (Val(Text14.Text) / Val(Text13.Text))
Option6.Value = True
End If
If Val(Text13.Text) <= Val(Text14.Text) <= Val(Text12.Text) Then
Text10.Text = Val(Text11.Text) + 1
Option5.Value = True
End If
If Val(Text14.Text) >= Val(Text12.Text) Then
Text10.Text = (Val(Text11.Text) + 1) * (Val(Text12.Text) / Val(Text14.Text)) ^ (2 / 3)
Option4.Value = True
End If
تفاوت شرط اول با دوم در unsafe zone هست . یعنی اگر شرط اول برقرار بشه تسکت باکس ها یه مقدار خاص بگیریند ولی اگر combobox11 بشه unsafe zone مقادیر تسکت باکس ها عوض بشن
این میبینه چون شرط اولی برقراره دیگه combo11 رو چک نمی کنه