Understanding Break Loops
 
 
 

Expressions are the basic structural units of AutoLISP, and VLISP works by repeatedly reading, evaluating, and printing expressions. In LISP terminology, this is a read-eval-print loop.

When you are running an AutoLISP program without any debugging intervention by VLISP, you are running in the Top-Level read-eval-print loop. When you evaluate an expression within the VLISP Console window, and the normal prompt is displayed, you are also working at the Top Level.

When a program's evaluation is interrupted or suspended in the middle of execution, VLISP passes control to the Console and you enter a break loop. This break loop is a separate read-eval-print loop, and is nested underneath the original read-eval-print loop. It is possible to interrupt a break loop and start yet another read-eval-print loop beneath it. The nesting level of a break loop with respect to the Top Level is called the break level.

When you enter a break loop, VLISP prefixes the Console prompt with a number indicating the level where you are located. For example, when you first enter a break loop in a program, the prompt indicates this with the number 1:

_1_$

While you are in a break loop, you cannot switch control to the AutoCAD window.

On exiting from a break loop (for example, after issuing the Quit command), the current read-eval-print loop is terminated and the previous level loop is resumed. If you change the value of a variable in the break loop, this value will be used when the program resumes execution.