Stop statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Suspends a running MapBasic application, for debugging purposes. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Stop 

Restrictions

You cannot issue a Stop statement from within a user-defined function or within a dialog box's handler procedure; therefore you cannot issue a Stop statement to debug a Dialog statement while the dialog box is still on the screen.

Description

The Stop statement is a debugging aid. It suspends the application which is running, and returns control to the user; presumably, the user in this case is a MapBasic programmer who is debugging a program.

When the Stop occurs, a message appears in the MapBasic window identifying the program line number of the Stop.

Following a Stop, you can use the MapBasic window to investigate the current status of the program. If you type:

? Dim

into the MapBasic window, MapInfo Pro displays a list of the local variables in use by the suspended program. Similarly, if you type:

? Global 

into the MapBasic window, MapInfo Pro displays a list of the global variables in use.

To display the contents of a variable, type a question mark followed by the variable name. To modify the contents of the variable, type a statement of this form:

variable_name = new_value

where variable_name is the name of a local or global variable, and new_value is an expression representing the new value to assign to the variable.

To resume the execution of the application, choose File > Continue; note that, while a program is stopped, Continue appears on the File menu instead of Run. You can also restart a program by typing a Continue statement into the MapBasic window.

During a Stop, MapInfo Pro keeps the application file open. As long as this file remains open, the application cannot be recompiled. If you use a Stop statement, and you then wish to recompile your application, choose File > Continue before attempting to recompile.

See Also:

Continue statement