Recording IDL Command Line Input

Journaling provides a record of an interactive session by saving all text entered from the Command Line in a file. In journaling, all text entered to the IDL prompt is entered directly into the file, and any text entered from the terminal in response to any other input request (such as with the READ procedure) is entered as a comment. The result is a file that contains a complete description of the IDL session. JOURNAL has the form:

JOURNAL[, Argument] 

where Argument is either a filename (if journaling is not currently in progress) or an expression to be written to the file (if journaling is active). The first call to JOURNAL starts the logging process. If no argument is supplied, a journal file named idlsave.pro is started.

Warning
Under all operating systems, creating a new journal file will cause any existing file with the same name to be lost. Supply a filename argument to JOURNAL to avoid destroying existing files.

When journaling is not in progress, the value of the system variable !JOURNAL is zero. When the journal file is opened, the value of this system variable is set to the number of the logical file unit on which the file is opened. This allows IDL routines to check if journaling is active. You can send any arbitrary data to this file using the normal IDL output routines. In addition, calling JOURNAL with an argument while journaling is in progress results in the argument being written to the journal file as if the PRINT procedure had been used. In other words, the statement,

JOURNAL, 

is equivalent to

PRINTF, !JOURNAL, Argument 

with one significant difference—the JOURNAL statement is not logged to the file, only its output; while the PRINTF statement will be logged to the file in addition to its output.

Journaling ends when the JOURNAL procedure is called again without an argument or when IDL is exited. The resulting file serves as a record of the interactive session that went on while journaling was active. It can be used later as an IDL batch input file to repeat the session, and it can be edited with any text editor if changes are necessary. See "JOURNAL" (IDL Reference Guide) for examples.