The Mathematica Journal
Departments
Current Issue
Tricks of the Trade
In and Out
Riemann Surfaces IIc
The Mathematica Programmer
New Products
New Publications
Classifieds
Calendar
News Bulletins
Library
Editor's Pick
Mailbox
FAQ
Write Us
About the Journal
Staff and Contributors
Submissions
Subscriptions
Advertising
Back Issues
Home
Download This Issue

Output Window

Q: Is there any way to separate input and output? I want to input code in one window and show the results in another.

A: P. J. Hinton (paulh@wolfram.com) writes: Here is a very simple implementation of what you describe using notebook manipulation functions. First, define a function named externalOutput that acts as a wrapper to NotebookWrite. This function needs to cope with Null output,

allow for recursive calls,

handle graphics,

and all other output.

Entering

prevents graphics from being displayed in the notebook with Input style cells.

To use externalOutput, create a global variable named $outputNotebook which points to the notebook where output is to be placed.

Setting $Post to use externalOutput means that all expressions returned by the kernel will be fed to the externalOutput function.

Here are three tests.

All output, including graphics, is displayed in the external notebook. Any expression that returns Null does not create an Output style cell.

See also "Exporting Graphics," TMJ, 7 (2), 1998 p. 130 and the Tech Support column, TMJ, 7(2), 1998 pp. 145-146.


Copyright © 2002 Wolfram Media, Inc. All rights reserved.

[Article Index][Prev Page][Next Page]