OutputDocument.LockContents

Prototypes

void LockContents( <boolean bLock> )

Parameters

boolean bLock
If bLock is true, the LISTING output document's lock count is incremented. If bLock is false, the LISTING output document's lock count is decremented. Calling this method without a parameter is equivalent to calling it with bLock equal to true.

Remarks

This method locks or unlocks the LISTING output document. A LISTING output document that is locked ignores new output generated by the IMLPlus program.

Each LISTING output document maintains a lock count. When the lock count is zero, the LISTING output document accepts new output. When the lock count is greater than zero, the LISTING output document ignores new output. If you call LockContents multiple times with bLock equal to true, you must call LockContents the same number of times with bLock equal to false to unlock the LISTING output document. When you rerun a program, IMLPlus resets the lock count of each LISTING output document to zero.

Example
print "This should be printed";

print "About to call LockContents()";
OutputDocument.GetDefault().LockContents();

print "This should not be printed";
Runtime.Print( "This should not be printed" );

/* no output from a submit block should be printed */
submit;
    proc reg data=SASHELP.prdsale;
    model actual = predict;
    run;
endsubmit;

declare DataObject dobj = DataObject.CreateFromFile( "Baseball" );
declare ScatterPlot plot;
plot = ScatterPlot.Create( dobj, "no_hits", "no_home" );
plot.CopyToOutputDocument(); /* ignored */

OutputDocument.GetDefault().LockContents( false );
print "Called LockContents( false )";

print "This should be printed";