| |

VerySource

 Forgot password?
 Register
Search
View: 898|Reply: 3

Help: Questions about doevents, online!

[Copy link]

3

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-19 19:40:01
| Show all posts |Read mode
During the running of my program, there is time to wait in a loop. In the loop, I mostly added doevents to return control to the system. But some machines will appear if you do not click my program, the program will not continue to run, after moving the program is normal (and then run), what is the reason, can it be caused by doevents? Thank you!
Reply

Use magic Report

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-27 12:54:01
| Show all posts
Code
Reply

Use magic Report

3

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Invalid IP Address

 Author| Post time: 2020-1-27 15:00:01
| Show all posts
Do Until intTestedNum> intTestNum
    Call addSam ()
    Application.DoEvents ()
    If stepI (0) = 51 And stepI (1) = 51 And stepI (2) = 51 And stepI (3) = 51 then exit do
Loop

addsam contains the status query code, and some loops also have doevents
Reply

Use magic Report

3

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Korea, Republic of

 Author| Post time: 2020-1-28 21:36:02
| Show all posts
Sub addSam ()
        Dim intDir As Integer
        Dim intRI As Integer
        Dim I As Integer
        '-------------------------------
        'Query the status of each mechanism and act in accordance with the sequence of actions
        '--------------------------------
        Select Case stepI (0)
            Case 0
                Call ZeroInjector (&HFC)
                stepI (0) = 1
                For intRI = intEndpointStartReagent To intEndpointEndReagent-1
                    If intAddSamNum + intEndpointStart = intSameReagent (intRI) Then
                        If intAddSamNum> = 1 Then
                            If intSamAddWater <2 then sngWashTimeFC = 3
                                Exit For
                            Else
                                sngWashTimeFC = 1.1
                            End If
                        End If
                        If boolSamBlank (intNowReagentFC) = False Then
                            sngWashTimeFC = 3
                        Else
                            sngWashTimeFC = 1.1
                        End If
                        Exit For
                    End If
                Next intRI
            Case 1
Below are similar codes
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list