Stop Statement (Visual Basic)
Suspends execution.
Syntax
Stop
Remarks
You can place Stop
statements anywhere in procedures to suspend execution. Using the Stop
statement is similar to setting a breakpoint in the code.
The Stop
statement suspends execution, but unlike End
, it does not close any files or clear any variables, unless it is encountered in a compiled executable (.exe) file.
Note
If the Stop
statement is encountered in code that is running outside of the integrated development environment (IDE), the debugger is invoked. This is true regardless of whether the code was compiled in debug or retail mode.
Example
This example uses the Stop
statement to suspend execution for each iteration through the For...Next
loop.
Dim i As Integer
For i = 1 To 10
Debug.WriteLine(i)
' Stop during each iteration and wait for user to resume.
Stop
Next i
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho