| |

VerySource

 Forgot password?
 Register
Search
View: 3350|Reply: 20

About loop waiting

[Copy link]

3

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 France

Post time: 2020-1-26 22:20:01
| Show all posts |Read mode
What does everyone do in a long waiting loop?
Reply

Use magic Report

0

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-19 02:45:01
| Show all posts
DoEvents
Reply

Use magic Report

3

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-2-20 21:15:01
| Show all posts
Can DoEvents be used in nested loops to cause problems, such as the situation that the program is temporarily unresponsive and needs to be operated to continue running.
Reply

Use magic Report

0

Threads

21

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-3-3 10:45:01
| Show all posts
Screen.MouseIcon = vbHourglass
When you're done:
Screen.MouseIcon = vbDefault

DoEvents words
The process of ensuring that control is given up with DoEvents cannot be called again by other code before the first DoEvents returns; otherwise, unpredictable results will be produced. In addition, if other applications may interact with this process in unpredictable ways, then do not use DoEvents, because you cannot give up control at this time.
Reply

Use magic Report

3

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-3-12 13:15:01
| Show all posts
I mean the program should continue to run normally, but it is not running. Click the interface to continue running. I wonder if it is caused by DoEvents
Reply

Use magic Report

0

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-8-14 17:00:01
| Show all posts
Yes. DoEvents can cause this problem,四不像君said very clearly.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-14 17:45:01
| Show all posts
What does "not running state appear" mean?
The function of DoEvents is to temporarily stop the execution of the statement under DoEvents of the current process or method, so that the system can process other message tasks in the message queue, and then return to the statement under DoEvents to continue execution after processing, without the need for people to manually click the interface!
Your problem should not be caused by DoEvents
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-8-14 20:00:01
| Show all posts
Use DoEvents with care
Reply

Use magic Report

2

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-8-14 21:30:01
| Show all posts
What did everyone do in a long-waiting cycle?

1. Generally, the "progress bar" is used to remind the cycle of progress

2. Use do loop instead of for loop, add doevents in between

3. DoEvents can only appear once in a loop, and cannot be nested, otherwise an error occurs
Reply

Use magic Report

0

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-8-15 12:00:01
| Show all posts
Whoever has problems using DoEvents, post the program code to see, how can this be said to be used carefully? ?
It's not that you can't use it! For loop == all kinds of improper use of statements will cause problems, should it be used carefully? ?
As long as the method is right, what will happen to DoEvents?
You can't call someone when DoEvents is paused. Even if the current procedure is called, it has no effect, just like a recursive function. Why can't you call yourself? ?
Answer: It won't work if it is wrong!
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