%CMDLNBGN Sets up for calling command line demos from DEMO.
%
%   See also CMDLNEND, DEMO

%   Ned Gulley, 6-21-93
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.5 $  $Date: 1997/11/21 23:25:19 $

% Here's the idea: we only want to have ONE unassigned, unnamed command line
% demo figure running around in order to avoid window proliferation. So since
% every other Expo demo figure has a name, before we run any of the old demos
% we'll first check to see if an unnamed figure is lying around.

if figureNeededFlag,
    oldFigNumber=watchon;

    figNumber=findobj('Type', 'figure', 'Name', []);
    
    if isempty(figNumber),
        pos=get(0,'DefaultFigurePosition');
    % Adjust the window down and to the left so that it doesn't
    % completely obscure the Expo Map window.
        pos=pos+[-50 -50 0 0];
        figNumber=figure('Position',pos);
    else
        figNumber=figNumber(1);
    end

    figure(figNumber);

    clear figNumber

end

clc

