Terminating the macro
The macro runtime terminates the macro when it finishes processing a macro screen that is marked as an exit screen.
In the example scenario Screen2 is marked as an exit screen (see Table 2).
The exit screen setting (an attribute of the <screen> element) exists for exactly this purpose, to mark macro screens that terminate the macro.
When a macro is recorded, the Macro object by default marks the last macro screen to be recorded as an exit screen. After recording is complete, the macro developer can mark (or unmark) any macro screen as an exit screen, and there can be multiple exit screens.
Exit screens are described in more detail in Exit screens.