OutputDocument.GetDefault

Prototypes

static OutputDocument GetDefault( <boolean bAutoCreate> )

Return Value

If the parameter bAutoCreate is true or there are existing LISTING output documents, the return value is a reference to the OutputDocument object for the default LISTING output document. If the parameter bAutoCreate is false and there are no existing LISTING output documents, the return value is null.

Parameters

boolean bAutoCreate
If bAutoCreate is true and there are no existing LISTING output documents, the method creates a new LISTING output document and designates it the default LISTING output document. If bAutoCreate is false and there are no existing LISTING output documents, the method does not create a LISTING output document and returns null. If there are existing LISTING output documents, the parameter bAutoCreate is ignored. Calling this method without a parameter is equivalent to calling it with bAutoCreate equal to true.

Remarks

This method gets a reference to the OutputDocument object for the default LISTING output document. The default LISTING output document is the LISTING output document to which IMLPlus routes subsequent output. The parameter bAutoCreate determines whether the method creates a LISTING output document if none exist.

If the method returns a reference to an existing LISTING output document, the temporary characteristic of the LISTING output document is not changed. If the parameter bAutoCreate is true, the LISTING output document potentially created by this method is not configured as a temporary LISTING output document as are the LISTING output documents created by the method OutputDocument.Create. When you rerun a program, IMLPlus automatically closes any temporary LISTING output documents created by the previous run. You can use the method OutputDocument.SetTemporary to control the temporary characteristic of a LISTING output document.

Example
x = ranuni( 1:5 );
print x;

declare OutputDocument doc = OutputDocument.GetDefault();
doc.SetTextSize( 22 );
doc.SetTextColor( RED );
print "Some important message";
doc.SetTextDefaultFont();

x = ranuni( 1:5 );
print x;
See Also

OutputDocument.Create
OutputDocument.SetDefault
OutputDocument.SetTemporary