function show(arg, varargin)
%SHOW     Bring all open specified scope instances to the foreground.
%   SHOW(name) brings the specified scope instance to the foreground,
%   moving it in front of other MATLAB windows as appropriate.
%
%   SHOW(name, 'all') moves all specified scope instances forward.

%   Copyright 2007-2010 The MathWorks, Inc.

if nargin<1
    m = matlabshared.scopes.find(0);  % current/most recent instance only
else
   if ~strcmpi(arg,'all')
       error(message('Spcuilib:scopes:ErrorArgumentNotAll'));
   end
   m = matlabshared.scopes.find(varargin{:});  % all instances
end

% Bring each instance forward
for i=numel(m):-1:1
    m(i).show;
end

% [EOF]
