Name

Stop Statement

Syntax

Stop

Description

Suspends program execution

Rules at a Glance

  • There is no limit to the number and position of Stop statements within procedures.

  • The Stop statement acts like a breakpoint — placing the program in break mode and highlighting the current line in the development environment — allowing you to step through the code line by line.

Programming Tips and Gotchas

  • Stop is intended primarily for use in the design-time environment, where it suspends program execution without terminating it. In the runtime environment, however, Stop will cause the debugger to be invoked.

  • Unlike the End statement, Stop does not explicitly close any open files or clear any variables, except in a compiled executable.

Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.