Previous IDL Reference Guide: Dot Commands Next

.SKIP

The .SKIP command skips one or more statements. It is useful for moving past a program statement that caused an error. If the optional argument n is present, it gives the number of statements to skip; otherwise, a single statement is skipped.

Note that .SKIP does not execute or evaluate the code it is skipping. Rather, it arbitrarily alters the current program counter to the nth physical statement following the current point. This has implications that may not be obvious on initial consideration:

In contrast, the .STEP executive command has none of the above drawbacks and can be used instead in many situations. The advantage of .SKIP over .STEP is that .SKIP can move past statements that .STEP cannot, such as:

For example, consider the following program segment:

...... ... ...  
OPENR, 1, 'missing'  
READF, 1, xxx, ..., ...  
... ... ...  

If the OPENR statement fails because the specified file does not exist, program execution will halt with the OPENR statement as the current statement. Execution can not be resumed with the executive command .CONTINUE because it attempts to re-execute the offending OPENR statement, causing the same error. The remainder of the program can be executed by entering .SKIP, which skips over the incorrect OPEN statement.


Note
.SKIP is an executive command. Executive commands can only be used at the IDL command prompt, not in programs.

Syntax

.SKIP [n]

  IDL Online Help (March 06, 2007)