Home > Software engineering >  VB runtime didn't response, which under the guidance of a great god for help
VB runtime didn't response, which under the guidance of a great god for help

Time:09-27

Dim z1, z2, z3, z4 As Single
Dim I As Single
Dim X, Y As Single
Dim t1, t2 As Single
Dim p As String
List1. Clear
T1=(Abs (X-ray Int) (X + 0.5) & lt;=0.02 And Abs (z1 - Int + 0.5) (z1) & lt;=0.001 _
And Abs (z2 - Int (z2 + 0.5)) & lt;=0.001 And Abs (z3 - Int + 0.5) (z3) & lt;=0.001 _
And Abs (z4 - Int + 0.5) (z4) & lt;=0.001)
For z1=70 To 120
For z2=70 To 120
For z3=70 To 120
For z4=70 To 120
X=z3 z1 *
Y=z2 * z4
If (z1 * z3)/(z2 * z4)=0.7853983 And t1 Then
End the If
P=the Format (z1, "@ @ @") & amp; Format (z2, "@ @ @ @") & amp; Format (z3, "@ @ @ @") & amp; The Format (z4, "@ @ @ @")
List1. AddItem p

Next
Next
Next
Next

CodePudding user response:

You this is not a "no response", but the code has serious problems,
A run will be stuck for a long time!
(1) your cycle the innermost of the empty If statement, written in the book are there?
(2) do you know this code, you will add to the List controls how many item!!!!!!
Is this article 51 * 51 * 51 51=6765201!!!!!!
Will they not say that the List controls can hold (estimated VB6 List controls up to 65535),
But the running time, with the general computer,
In the IDE runtime can add 2000 operations per second,
This piece of code, you finish it to more than 50 minutes to perform!
You say, it would not "stuck" (no response)???????
  • Related